summaryrefslogtreecommitdiffabout
path: root/debian/iii.init
authorMichael Krelin <hacker@klever.net>2009-03-08 20:09:21 (UTC)
committer Michael Krelin <hacker@klever.net>2009-03-08 20:09:21 (UTC)
commitaadaa8b5d7eda23e72dbded9d6437b40358353f3 (patch) (side-by-side diff)
tree0bff6fdde1e2b9be02b48aaf7d03f095604718e1 /debian/iii.init
downloadiii-aadaa8b5d7eda23e72dbded9d6437b40358353f3.zip
iii-aadaa8b5d7eda23e72dbded9d6437b40358353f3.tar.gz
iii-aadaa8b5d7eda23e72dbded9d6437b40358353f3.tar.bz2
Inital commit to public repository0.0
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