All pastes #283003 Raw Edit

mikesee

public shellscript v1 · immutable
#283003 ·published 2006-12-18 00:46 UTC
rendered paste body
#!/bin/sh#--------------------------------------------------#          Cron script for EnergyMech 3.0#--------------------------------------------------## you can add this to your crontab (crontab -e) as# something like:## 0,10,20,30,40,50 * * * * /path/to/checkmech## this will check the mech every 10 minutes.##--------------------------------------------------# CHANGE THIS LINE!!#cd /home/cstrike/emech/# name of executable#RUN=./energymech# options passed to the energymech# ( debug, non-default config file... )#OPT=-f mech.set# example: debug output to `mech.debug' file#OPT=-d -o mech.debug# example: non-default configuration file#OPT=-f othermech.conf# Send output to...OUTPUT=/home/cstrike/emech/mech.cron#OUTPUT=/dev/nullif [ -r /home/cstrike/emech/mech.pid ]; then  PID=`cat /home/cstrike/emech/mech.pid`  if [ -r /proc/$PID ]; then    exit 0  fi  if ( kill -0 $PID 1> /dev/null 2> /dev/null ); then    exit 0  fifi# its not running...echo >> $OUTPUTecho "Mech restarted:" >> $OUTPUT( date 2>&1 ) >> $OUTPUTecho >> $OUTPUT#( $RUN $OPT 2>&1 ) >> $OUTPUT( /home/cstrike/emech/energymech 2>&1 ) >> $OUTPUT