1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-07 22:58:11 +00:00
freebsd-ports/www/tclhttpd/files/tclhttpd.sh

25 lines
439 B
Bash
Raw Normal View History

#!/bin/sh
PID_FILE=/var/run/tclhttpd.pid
case $1 in
stop)
if [ -e $PID_FILE ] ; then
PID=`cat $PID_FILE`
if kill $PID ; then
exec rm -f $PID_FILE
fi
else
echo "No $PID_FILE presenet, tclhttpd is, probably, not running" > /dev/stderr
fi
;;
''|start)
COMMAND_LINE &
sleep 2
if kill -0 $! ; then
echo -n ' tclhttpd'
echo $! > $PID_FILE
else
exec logger -s "tclhttpd failed to start"
fi
;;
esac