DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-04-25 14:25:04

tigerszheng
New member
Registered: 2010-10-26
Posts: 2

how to write customized shell script based on fun_plug?

Since the system is unstable enough, sometimes it will freeze and the transmission process will shutdown with no sign and no error log recorded.

So I think of write a script to monitor the process. but the shell always report errors on it.

I attach script below:


#!/ffp/bin/sh

PATH=/ffp/sbin:/ffp/bin:$PATH

LOGFILE="/mnt/HD_a2/scriptandlog/syscheck.log"


ps -e | grep transmission
if ( ($?) )
then
        date >> $LOGFILE
        echo "DAMN IT, the transmission is DOWN again!!! We need ReStart daemon" >> $LOGFILE
        /ffp/start/transmission.sh start
        exit 1
else
        echo "GOOD, the transmission is still here, we continue to do it" >>  $LOGFILE
        exit 0
fi

the error information is the the last line "fi", shows that "./syscheck.sh: line 18: 0: not found".

So what's the problem of this script?

Thanks

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB