#!/bin/sh pwd > dir dir=$(cat dir) echo "* * * * * $dir/update >/dev/null 2>&1" > cron crontab cron crontab -l | grep update echo "#!/bin/sh if test -r $dir/pid; then pid=\$(cat $dir/pid) if \$(kill -CHLD \$pid >/dev/null 2>&1) then exit 0 fi fi cd $dir ./run &>/dev/null" > update chmod u+x update