summaryrefslogtreecommitdiff
path: root/social/netatalk/netatalk.rc
diff options
context:
space:
mode:
Diffstat (limited to 'social/netatalk/netatalk.rc')
-rw-r--r--social/netatalk/netatalk.rc44
1 files changed, 44 insertions, 0 deletions
diff --git a/social/netatalk/netatalk.rc b/social/netatalk/netatalk.rc
new file mode 100644
index 000000000..f14d67ee3
--- /dev/null
+++ b/social/netatalk/netatalk.rc
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+NAME="Appletalk Services Daemon"
+ARGS=
+DAEMON=netatalk
+
+[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
+
+PID=`get_pid $DAEMON`
+
+case "$1" in
+ start)
+ stat_busy "Starting $NAME"
+ [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
+ if [ $? = 0 ]; then
+ add_daemon $DAEMON
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping $NAME"
+ [ -n "$PID" ] && kill $PID &>/dev/null
+ if [ $? = 0 ]; then
+ rm_daemon $DAEMON
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac