portspoof/system_files/init.d/portspoof.sh

35 lines
757 B
Bash
Raw Normal View History

2013-07-16 14:06:26 +00:00
#!/bin/sh
2013-07-22 12:36:59 +00:00
# Starts and stops Portspoof daemon
2013-07-16 14:06:26 +00:00
#
case "$1" in
start)
if ! pidof portspoof >/dev/null; then
echo "Starting Portspoof..."
2013-07-26 09:04:28 +00:00
/usr/local/bin/portspoof -D -c /usr/local/etc/portspoof.conf -s /usr/local/etc/portspoof_signatures
2013-07-16 14:06:26 +00:00
else
echo "Portspoof already running.."
fi
;;
stop)
if pidof portspoof >/dev/null; then
2013-07-26 09:04:28 +00:00
killall -9 /usr/local/bin/portspoof >/dev/null
2013-07-16 14:06:26 +00:00
echo "Portspoof stopped.."
else
echo "Portspoof not running.."
fi
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac