summaryrefslogtreecommitdiffabout
path: root/debian/iii.init
Side-by-side diff
Diffstat (limited to 'debian/iii.init') (more/less context) (ignore whitespace changes)
-rwxr-xr-xdebian/iii.init57
1 files changed, 57 insertions, 0 deletions
diff --git a/debian/iii.init b/debian/iii.init
new file mode 100755
index 0000000..c60c25e
--- a/dev/null
+++ b/debian/iii.init
@@ -0,0 +1,57 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: iii
+# Required-Start: $remote_fs $network
+# Required-Stop: $remote_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start iii eye-fi card manager daemon.
+### END INIT INFO
+
+set -e
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+NAME=iii
+DAEMON=/usr/sbin/${NAME}d
+DESC="Eye-Fi card manager daemon"
+PIDFILE=/var/run/${NAME}d.pid
+SCRIPTNAME=/etc/init.d/$NAME
+USER=eyefi
+SSD="/sbin/start-stop-daemon"
+
+test -x $DAEMON || exit 0
+
+if [ -f /etc/default/$NAME ] ; then
+ . /etc/default/$NAME
+ fi
+
+test -z "$NO_IIID" || exit 0
+
+. /lib/lsb/init-functions
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting $DESC" $NAME
+ $SSD --start --pidfile $PIDFILE --chuid $USER --background --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
+ log_end_msg $?
+ ;;
+ stop)
+ log_daemon_msg "Stopping $DESC" $NAME
+ if $SSD --stop --oknodo --retry 30 --pidfile $PIDFILE --exec $DAEMON ; then
+ rm -f $PIDFILE
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ restart|force-reload)
+ $SCRIPTNAME stop
+ $SCRIPTNAME start
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0