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) (unidiff)
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 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: iii
4# Required-Start: $remote_fs $network
5# Required-Stop: $remote_fs $network
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Start iii eye-fi card manager daemon.
9### END INIT INFO
10
11set -e
12
13PATH=/sbin:/bin:/usr/sbin:/usr/bin
14NAME=iii
15DAEMON=/usr/sbin/${NAME}d
16DESC="Eye-Fi card manager daemon"
17PIDFILE=/var/run/${NAME}d.pid
18SCRIPTNAME=/etc/init.d/$NAME
19USER=eyefi
20SSD="/sbin/start-stop-daemon"
21
22test -x $DAEMON || exit 0
23
24if [ -f /etc/default/$NAME ] ; then
25 . /etc/default/$NAME
26 fi
27
28test -z "$NO_IIID" || exit 0
29
30. /lib/lsb/init-functions
31
32case "$1" in
33 start)
34 log_daemon_msg "Starting $DESC" $NAME
35 $SSD --start --pidfile $PIDFILE --chuid $USER --background --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
36 log_end_msg $?
37 ;;
38 stop)
39 log_daemon_msg "Stopping $DESC" $NAME
40 if $SSD --stop --oknodo --retry 30 --pidfile $PIDFILE --exec $DAEMON ; then
41 rm -f $PIDFILE
42 log_end_msg 0
43 else
44 log_end_msg 1
45 fi
46 ;;
47 restart|force-reload)
48 $SCRIPTNAME stop
49 $SCRIPTNAME start
50 ;;
51 *)
52 echo "Usage: $SCRIPTNAME {start|stop}" >&2
53 exit 1
54 ;;
55esac
56
57exit 0