![]() ![]() |
hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/bin/bash# chkconfig: 12345 55 45# description: System statisticscd "/opt/HotSaNIC". ./settingscase $1 instart)echo "Loading rrdtimer folder..."posledni=`ls -c /opt_* | head -n 1 `cd "/"tar xfz $poslednicd "/opt/HotSaNIC"echo "Starting rrdtimer..."./rrdtimer.pl Dp;;stop)echo "Saving rrdtimer folder..."/usr/local/bin/mrwdatum=`date '+%Y%m%d%H%M%S'`archiv=/opt_$datum.tgztar cfz $archiv /opt/HotSaNIC/usr/local/bin/mroecho "Stopping rrdtimer..."if [ -e "$PIDFILE" ]; thenPID=`cat "$PIDFILE"`for nn in $PID ; do kill $nn; doneelseecho "pid-file not found, rrdtimer not running?!"fi./clearall CLEAR_COUNTERS;;status)if [ -e $PIDFILE ]; thenecho "main process on PID `cat $PIDFILE` (according to PID-file)"elseecho "pid-file not found, rrdtimer not running?!"fi;;restart)./rrdgraph stop./rrdgraph start;;*)echo "usage: rrdgraph [start|stop|status|restart]";;esac