Listing 1. restart_script

#!/bin/sh
# Restart script for your Freenet node. Restarts
# the node software and moves log file to
# freenet.log.bak Note that this will kill any other
# java software currently running.
cd ~/freenet
killall java
sleep 10
killall -9 java &> /dev/null
rm nohup.out
mv freenet.log freenet.log.bak
nice -19 nohup ./freenet_server &