PKGBUILDs/aur/netatalk/netatalk.rc

45 lines
678 B
Text
Raw Normal View History

2012-05-07 01:58:33 +00:00
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
2012-07-24 03:24:40 +00:00
NAME="Appletalk Services Daemon"
ARGS=
2012-05-07 01:58:33 +00:00
DAEMON=netatalk
2012-07-24 03:24:40 +00:00
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
2012-05-07 01:58:33 +00:00
2012-07-24 03:24:40 +00:00
PID=`get_pid $DAEMON`
2012-05-07 01:58:33 +00:00
case "$1" in
start)
2012-07-24 03:24:40 +00:00
stat_busy "Starting $NAME"
[ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
add_daemon $DAEMON
stat_done
else
stat_fail
exit 1
fi
;;
2012-05-07 01:58:33 +00:00
stop)
2012-07-24 03:24:40 +00:00
stat_busy "Stopping $NAME"
[ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
rm_daemon $DAEMON
stat_done
else
stat_fail
exit 1
fi
;;
2012-05-07 01:58:33 +00:00
restart)
2012-07-24 03:24:40 +00:00
$0 stop
sleep 1
$0 start
;;
2012-05-07 01:58:33 +00:00
*)
2012-07-24 03:24:40 +00:00
echo "usage: $0 {start|stop|restart}"
2012-05-07 01:58:33 +00:00
esac