Compare commits

...

5 commits

View file

@ -1,20 +1,24 @@
#!/bin/tcsh #!/bin/tcsh
echo "FreeNAS Gogs installation script." echo "FreeNAS Gogs installation script."
echo "This has been tested on:" echo "This has been tested on:"
echo " 9.3-RELEASE-p29" echo " FreeNAS 9.10"
echo echo
echo echo
echo "Press any key to begin" echo "Press any key to begin"
set jnk = $< set jnk = $<
if ( -f /usr/locat/etc/rc.d/gogs ) then echo "Updatiing system ..."
echo "Updating Gogs..." /usr/sbin/pkg update -f && /usr/sbin/pkg upgrade -y
if ( -f /usr/local/etc/rc.d/gogs ) then
echo "Gogs Install found. Updating..."
echo echo
# Stop Gogs service # Stop Gogs service
service gogs stop service gogs stop
./gogs-compile.sh ./gogs-compile.sh
echo "Update Done!" echo "Update Done!"
else else
echo "Install Gogs from zero"
# 3) Enable SSH # 3) Enable SSH
echo "Enabling SSH" echo "Enabling SSH"
/usr/bin/sed -i '.bak' 's/sshd_enable="NO"/sshd_enable="YES"/g' /etc/rc.conf /usr/bin/sed -i '.bak' 's/sshd_enable="NO"/sshd_enable="YES"/g' /etc/rc.conf
@ -25,10 +29,6 @@ else
echo "Starting SSH Service" echo "Starting SSH Service"
/usr/sbin/service sshd start /usr/sbin/service sshd start
# 4) Update packages and upgrade any. # 4) Update packages and upgrade any.
echo "Updating packages"
/usr/sbin/pkg update -f
echo "Upgrading packages"
/usr/sbin/pkg upgrade -y
echo "Installing memcached, redis & go" echo "Installing memcached, redis & go"
/usr/sbin/pkg install -y memcached redis go git bash /usr/sbin/pkg install -y memcached redis go git bash
echo "Enabling & starting memcached & redis" echo "Enabling & starting memcached & redis"
@ -47,7 +47,7 @@ else
chown -R git:git $GITHOME chown -R git:git $GITHOME
su - git -c "/usr/bin/ssh-keygen -b 2048 -N '' -f ~/.ssh/id_rsa -t rsa -q &" su - git -c "/usr/bin/ssh-keygen -b 2048 -N '' -f ~/.ssh/id_rsa -t rsa -q &"
# 6) Get & compile gogs # 6) Get & compile gogs
gogs-compile.sh ./gogs-compile.sh
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 gogs_enable="YES" >> /etc/rc.conf echo gogs_enable="YES" >> /etc/rc.conf