Browse Source

nearly complete install script

rkaldung 10 years ago
parent
commit
4109266fa5
1 changed files with 9 additions and 2 deletions
  1. 9 2
      script/install.sh

+ 9 - 2
script/install.sh

@@ -21,7 +21,8 @@ function check_os()
 {
     # Debian
     if [ -f /etc/debian_version ]; then
-        MAJOR=$(cut -d. /etc/debian_version -f1)
+        OS=Debian
+        local MAJOR=$(cut -d. /etc/debian_version -f1)
         if [ $MAJOR -lt 7 ]; then
             echo Please check the supported operating systems
             exit 1
@@ -30,7 +31,6 @@ function check_os()
 }
 
 check_requirements
-
 check_os
 
 
@@ -97,3 +97,10 @@ sudo -u "${USER}" -H bash -l -c 'cd ~/zammad && RAILS_ENV=production rake db:mig
 sudo -u "${USER}" -H bash -l -c 'cd ~/zammad && RAILS_ENV=production rake db:seed'
 sudo -u "${USER}" -H bash -l -c 'cd ~/zammad && RAILS_ENV=production rake assets:precompile'
 
+cp "${HOMEDIR}/zammad/script/init.d/zammad /etc/init.d/zammad"
+chmod +x /etc/init.d/zammad
+
+if [ "$OS" = "Debian" ]; then
+  update-rc.d zammad defaults
+fi
+