]> jfr.im git - irc/thales.git/blame - contrib/Crontab/cron.sh
counter moved from contrib to examples due to z-master agreeing to release it under...
[irc/thales.git] / contrib / Crontab / cron.sh
CommitLineData
2ace9480 1#! /bin/sh
2
3# Thales CRONTAB script
4# Written by Jollino <jollino@sogno.net>
5# Improved by Lucas <lucas@lucas-nussbaum.net>
6
7# CONFIGURATION
8
9thales_dir='/home/lucas/thales'
10# you might want to add the -v parameter to generate more output
11thales_exec='./thales'
12thales_pid='thales.pid'
13thales_log='thales.log'
14
15# SCRIPT
16
17cd $thales_dir
18if [ -f $thales_pid ]; then
19 pid=`cat $thales_pid`
20 if [ `ps -p $pid | wc -l` -eq 2 ]; then
21 exit
22 else
23 echo "Pidfile was stale."
24 fi
25fi
26
27echo "Looks like Thales died... let's relaunch it"
28backuplogname=$thales_log.`date '+%s'`
29mv $thales_log $backuplogname
30gzip $backuplogname
31$thales_exec