copy rc.d script done by compile()

This commit is contained in:
Yorick Barbanneau 2015-11-12 12:21:32 +01:00
parent adc9162d3a
commit 5bb7d164d8

View file

@ -13,13 +13,14 @@ else
install() install()
endif endif
update () {a update () {
echo "Updating Gogs..." echo "Updating Gogs..."
echo echo
# Stop Gogs service # Stop Gogs service
service gogs stop service gogs stop
compile() compile()
service gogs start service gogs start
echo "Update Done!"
} }
install { install {
@ -58,11 +59,6 @@ install {
compile () compile ()
su - git -c "ln -s /usr/home/git/.ssh/ /usr/home/git/gogs/" su - git -c "ln -s /usr/home/git/.ssh/ /usr/home/git/gogs/"
# 7) Start up scripts # 7) Start up scripts
echo "Copying startup script to rc.d, enabling & starting gogs"
#/usr/bin/sed 's/\/home\/git/\/home\/git\/gogs/g' /home/git/go/src/github.com/gogits/gogs/scripts/init/freebsd/gogs
cp /home/git/go/src/github.com/gogits/gogs/scripts/init/freebsd/gogs /usr/local/etc/rc.d/
sed -i -e 's/\/home\/git/\/home\/git\/gogs/g' /usr/local/etc/rc.d/gogs
chmod +x /usr/local/etc/rc.d/gogs
echo gogs_enable="YES" >> /etc/rc.conf echo gogs_enable="YES" >> /etc/rc.conf
service gogs start service gogs start
} }
@ -78,6 +74,11 @@ compile() {
su - git -c "cp -R /usr/home/git/go/src/github.com/gogits/gogs /home/git/" su - git -c "cp -R /usr/home/git/go/src/github.com/gogits/gogs /home/git/"
# Change ownership of everything in the git directory # Change ownership of everything in the git directory
chown -R git:git /usr/home/git/ chown -R git:git /usr/home/git/
echo "Copying startup script to rc.d, enabling & starting gogs"
#/usr/bin/sed 's/\/home\/git/\/home\/git\/gogs/g' /home/git/go/src/github.com/gogits/gogs/scripts/init/freebsd/gogs
cp /home/git/go/src/github.com/gogits/gogs/scripts/init/freebsd/gogs /usr/local/etc/rc.d/
sed -i -e 's/\/home\/git/\/home\/git\/gogs/g' /usr/local/etc/rc.d/gogs
chmod +x /usr/local/etc/rc.d/gogs
} }
echo echo