2 # This file belongs in /etc/rc.d
4 ###############################################################################
6 #inserting certain functions (like stat_busy)
10 # Check the file is there and is executable.
11 [ -x /usr
/bin
/feed_db.pl
] ||
exit 0
13 PID
=`pidof -o %PPID /usr/bin/perl /usr/bin/feed_db.pl`
15 # See how we were called.
18 stat_busy
"Starting IPtables Logging Daemon "
19 if [ -z "$PID" ]; then
20 /usr
/bin
/feed_db.pl
>/dev
/null
&
21 RETVAL
=$?
#storing the status of the last command to RETVAL
22 if [ $?
-gt 0 ]; then #if the status was other than 0, the command failed
31 echo ":: Daemon already started as pid $PID"
36 stat_busy
"Stopping IPtables Logging Daemon "
37 if [ "$PID" != "" ]; then #if PID exists
38 kill -KILL $PID &>/dev
/null
49 echo ":: Daemon already stopped"
59 echo "Usage: partimaged {start|stop|restart|reload}"