Author: nextgens
Date: 2008-06-02 13:55:05 +0000 (Mon, 02 Jun 2008)
New Revision: 20178
Modified:
trunk/apps/new_installer/res/unix/bin/install_autostart.sh
trunk/apps/new_installer/scripts/1run.sh
Log:
new_installer: make the headless installer set a crontab up too
Modified: trunk/apps/new_installer/res/unix/bin/install_autostart.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/install_autostart.sh 2008-06-01
13:30:08 UTC (rev 20177)
+++ trunk/apps/new_installer/res/unix/bin/install_autostart.sh 2008-06-02
13:55:05 UTC (rev 20178)
@@ -14,17 +14,19 @@
then
echo "Installing cron job to start Freenet on reboot..."
crontab -l 2>/dev/null > autostart.install
- echo "@reboot \"$INSTALL_PATH/run.sh\" start 2>&1 >/dev/null
#FREENET AUTOSTART - 8888" >> autostart.install
+ echo "@reboot \"$PWD/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
+ fi
+
+ if test -s autostart.install
+ then
+ rm -f autostart.install
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/scripts/1run.sh
===================================================================
--- trunk/apps/new_installer/scripts/1run.sh 2008-06-01 13:30:08 UTC (rev
20177)
+++ trunk/apps/new_installer/scripts/1run.sh 2008-06-02 13:55:05 UTC (rev
20178)
@@ -1,18 +1,19 @@
#!/bin/sh
-if test ! -s bin/1run.sh
+if test -s freenet.ini
then
- echo 'This script should be started using ./bin/1run.sh!'
+ echo "This script isn\'t meant to be used more than once."
+ rm -f bin/1run.sh
exit
fi
-if test -s freenet.ini
+if test ! -s bin/1run.sh
then
- echo "This script isn\'t meant to be used more than once."
- rm -f bin/1run.sh
+ echo 'This script should be started using ./bin/1run.sh!'
exit
fi
+
CAFILE="startssl.pem"
# We need the exec flag on /bin
@@ -68,6 +69,24 @@
echo "Downloading seednodes.fref"
java -jar bin/sha1test.jar seednodes.fref "." $CAFILE >/dev/null || exit 1
+if test -x `which crontab`
+then
+ echo "Installing cron job to start Freenet on reboot..."
+ crontab -l 2>/dev/null > autostart.install
+ echo "@reboot \"$PWD/run.sh\" start 2>&1 >/dev/null #FREENET
AUTOSTART - $FPROXY_PORT" >> autostart.install
+ if crontab autostart.install
+ then
+ echo Installed cron job.
+ fi
+fi
+
+if test -s autostart.install
+then
+ rm -f autostart.install
+else
+ echo Cron appears not to be installed, you will have to run run.sh
start manually to start Freenet after a reboot.
+fi
+
# Starting the node up
./run.sh start