Commits

stacklet committed b270794

Use the gel 6 cpanel scripts for gel 5 as well to maintain consistency

Comments (0)

Files changed (3)

specs/distro/gel/5/cpanel/assets/cpanel.sh

+#!/bin/bash
+
+if [ -d /usr/local/cpanel ]; then
+  echo "CPanel is already installed -- exiting"
+  exit 1
+fi
+
+cd /home
+
+for i in {1..5}
+do
+   wget -SN --retry-connrefused --tries 5 http://httpupdate.cpanel.net/latest
+   if [[ $? -eq 0 ]] ; then
+    break
+   fi
+   echo 'Retry in three seconds'
+   sleep 3
+done
+
+if [[ -e './latest' ]] ; then
+  echo 'Retrieved http://httpupdate.cpanel.net/latest'
+  chkconfig stkinstall off
+  chmod a+x latest
+  ./latest
+else
+  echo 'Could not retrieve http://httpupdate.cpanel.net/latest'     
+  exit 1
+fi
+
+
+

specs/distro/gel/5/cpanel/assets/stkinstall

 # See how we were called.
 case "$1" in
   start)
-        chkconfig stkinstall off
         echo -n "Installing CPanel: "
-
-        if [ -d /usr/local/cpanel ]; then
-          echo "CPanel is already installed -- exiting"
-          exit 1
-        fi
-
-        cd /home
-        echo "please see installation log at /home/nohup.out"
-        nohup wget -N http://httpupdate.cpanel.net/latest
-        nohup sh latest &
+        cd /root
+        nohup /root/cpanel.sh &
         ;;
   stop|status|restart|reload)
         ;;

specs/distro/gel/5/cpanel/cpanel.xml

     <stk:command>
       chmod a+x /etc/init.d/stkinstall;chown root:root /etc/init.d/stkinstall 
     </stk:command>
+    <stk:file>
+      <loc>/root</loc>
+      <name>cpanel.sh</name>
+      <exists>replace</exists>
+      <stk:content>
+        <loc>_build.assetLoc_</loc>
+        <name>cpanel.sh</name>
+      </stk:content>
+    </stk:file>
+    <stk:command>
+      chmod a+x /root/cpanel.sh;
+    </stk:command>
     <stk:service>
       <enable>
         stkinstall