#!/bin/sh kill $(cat /var/run/script.pid) base=`dirname $0` cd $base nohup ./script.sh &