PKGBUILDs/core/heimdal/heimdal-kdc.rc

41 lines
778 B
Plaintext
Raw Normal View History

2009-09-26 14:35:50 +00:00
#!/bin/bash
# general config
2009-09-26 16:05:27 +00:00
. /opt/etc/rc.conf
. /opt/etc/rc.d/functions
2009-09-26 14:35:50 +00:00
2009-09-26 16:05:27 +00:00
PID=`pidof -o %PPID /opt/sbin/kdc`
2009-09-26 14:35:50 +00:00
case "$1" in
start)
stat_busy "Starting heimdal kdc"
if [ -z "$PID" ]; then
2009-09-26 16:05:27 +00:00
/opt/sbin/kdc --detach
2009-09-26 14:35:50 +00:00
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
add_daemon heimdal-kdc
stat_done
fi
;;
stop)
stat_busy "Stopping heimdal kdc"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon heimdal-kdc
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac
exit 0