Author: nextgens
Date: 2008-05-03 14:50:09 +0000 (Sat, 03 May 2008)
New Revision: 19701

Modified:
   trunk/apps/new_installer/res/unix/bin/detect_port_availability.sh
   trunk/apps/new_installer/res/unix/bin/install_autostart.sh
   trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
Log:
new_installer: improve the cronjob creation

Modified: trunk/apps/new_installer/res/unix/bin/detect_port_availability.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/detect_port_availability.sh   
2008-05-03 14:47:36 UTC (rev 19700)
+++ trunk/apps/new_installer/res/unix/bin/detect_port_availability.sh   
2008-05-03 14:50:09 UTC (rev 19701)
@@ -21,6 +21,14 @@
        cat bin/browse.sh | sed "s/8888/$FPROXY_PORT/g" > browse.sh
        mv browse.sh bin/browse.sh

+       cat bin/install_autostart.sh | sed "s/8888/$FPROXY_PORT/g" > 
install_autostart.sh
+       mv install_autostart.sh bin/install_autostart.sh
+
+       cat bin/remove_cronjob.sh | sed "s/8888/$FPROXY_PORT/g" > 
remove_cronjob.sh
+       mv remove_cronjob.sh bin/remove_cronjob.sh
+
+       chmod u+rx bin/*sh
+
        if test -e firefox_profile/user.js
        then
                cat firefox_profile/user.js | sed "s/8888/$FPROXY_PORT/g" 
>user.js.tmp

Modified: trunk/apps/new_installer/res/unix/bin/install_autostart.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/install_autostart.sh  2008-05-03 
14:47:36 UTC (rev 19700)
+++ trunk/apps/new_installer/res/unix/bin/install_autostart.sh  2008-05-03 
14:50:09 UTC (rev 19701)
@@ -13,19 +13,18 @@
        if test -x `which crontab`
        then
                echo "Installing cron job to start Freenet on reboot..."
-               rm -f crontab.tmp
-               crontab -l > crontab.tmp
-               echo "@reboot   \"$INSTALL_PATH/run.sh\" start" >> crontab.tmp
-               if crontab crontab.tmp
+               crontab -l > autostart.install
+               echo "@reboot   \"$INSTALL_PATH/run.sh\" start 2>&1 >/dev/null 
#FREENET AUTOSTART - 8888" >> autostart.install
+               if crontab autostart.install
                then
                        echo Installed cron job.
                else
                        echo Could not install cron job, you will have to run 
run.sh start manually to start Freenet after a reboot.
                fi
-               rm crontab.tmp
        else
                echo Cron appears not to be installed, you will have to run 
run.sh start manually to start Freenet after a reboot.
        fi
 else
        echo Auto-start is disabled, you will have to run run.sh start manually 
to start Freenet after a reboot.
 fi
+rm -f autostart.install

Modified: trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh     2008-05-03 
14:47:36 UTC (rev 19700)
+++ trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh     2008-05-03 
14:50:09 UTC (rev 19701)
@@ -1,10 +1,7 @@
 #!/bin/sh

-crontab -l > crontab.tmp
-if grep -F "@reboot   \"$INSTALL_PATH/run.sh\" start" crontab.tmp
+if grep -c " #FREENET AUTOSTART - 8888$" -gt 0
 then
        echo Found service in crontab, removing it...
-       cat crontab.tmp | grep -v -F "@reboot   \"$INSTALL_PATH/run.sh\" start" 
- > crontab.tmp.new
-       crontab crontab.tmp.new
+       crontab -l | grep -v " #FREENET AUTOSTART - 8888$" | crontab -
 fi
-rm -f crontab.tmp crontab.tmp.new


Reply via email to