diff --git a/gogs-root.sh b/gogs-root.sh index b9efaf7..0e1d29a 100755 --- a/gogs-root.sh +++ b/gogs-root.sh @@ -1,20 +1,24 @@ #!/bin/tcsh echo "FreeNAS Gogs installation script." echo "This has been tested on:" -echo " 9.3-RELEASE-p29" +echo " FreeNAS 9.10" echo echo echo "Press any key to begin" set jnk = $< -if ( -f /usr/locat/etc/rc.d/gogs ) then - echo "Updating Gogs..." +echo "Updatiing system ..." +/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 # Stop Gogs service service gogs stop ./gogs-compile.sh echo "Update Done!" else + echo "Install Gogs from zero" # 3) Enable SSH echo "Enabling SSH" /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" /usr/sbin/service sshd start # 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" /usr/sbin/pkg install -y memcached redis go git bash echo "Enabling & starting memcached & redis" @@ -47,7 +47,7 @@ else chown -R git:git $GITHOME su - git -c "/usr/bin/ssh-keygen -b 2048 -N '' -f ~/.ssh/id_rsa -t rsa -q &" # 6) Get & compile gogs - gogs-compile.sh + ./gogs-compile.sh su - git -c "ln -s /usr/home/git/.ssh/ /usr/home/git/gogs/" # 7) Start up scripts echo gogs_enable="YES" >> /etc/rc.conf