1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/net/hawk/files/hawk.sh
Doug Barton 94c52d8c7f New port of a nifty utilty that uses perl to ping the networks you
specify, mysql to save the data, and php to display it. Fairly
configurable, and easy to set up.
2003-02-13 11:20:38 +00:00

35 lines
441 B
Bash

#!/bin/sh
PATH=/bin:/usr/bin
export PATH
stop_hawk () {
if [ -f /var/run/hawk.pid ];then
kill `cat /var/run/hawk.pid`
else
ps -ax | awk '/[h]awk$/ {print $1}' | xargs kill
fi
}
case "${1}" in
start)
echo 'Starting hawk'
%%PREFIX%%/sbin/hawk &
;;
stop)
echo 'Stopping hawk'
stop_hawk
;;
restart)
echo 'Restarting hawk'
stop_hawk
%%PREFIX%%/sbin/hawk &
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0