2 # Start/stop the tuer status updater.
5 # Provides: tuer_status
6 # Required-Start: $remote_fs $syslog $time tuer_core tuer_presence
7 # Required-Stop: $remote_fs $syslog $time tuer_core tuer_presence
8 # Default-Start: 2 3 4 5
12 EXE_UWEB=/flash/tuer/r3-netstatus
13 STATE_DIR=/flash/var/lib/r3netstatus/
18 [ -n "$XMPPJID" ] && CFG_UWEB="$CFG_UWEB --xjid $XMPPJID"
19 [ -n "$XMPPPASS" ] && CFG_UWEB="$CFG_UWEB --xpass $XMPPPASS"
20 [ -n "$XMPPBOTAUTH" ] && CFG_UWEB="$CFG_UWEB --xbotauth $XMPPBOTAUTH"
23 PIDFILE_UWEB=${DIR_RUN}/r3-netstatus.pid
25 test -f $EXE_UWEB || exit 1
26 if [ ! -d $DIR_RUN ]; then
27 mkdir -p $DIR_RUN || exit 2
28 chown -R $DOOR_USR:$DOOR_GRP $DIR_RUN
31 if [ ! -d $STATE_DIR ]; then
32 mkdir -p $STATE_DIR || exit 2
33 chown -R $DOOR_USR:$DOOR_GRP $STATE_DIR
36 . /lib/lsb/init-functions
38 # Read the system's locale and set cron's locale. This locale
39 # will be inherited by cron (used to set charset of emails)
40 # and tasks running under it.
44 log_daemon_msg "Starting xmpp and web status daemon" r3-netstatus
45 start-stop-daemon --start --quiet --pidfile $PIDFILE_UWEB -b -m -c $DOOR_USR --startas $EXE_UWEB -- $CFG_UWEB
49 log_daemon_msg "Stopping xmpp and web status daemon" r3-netstatus
50 start-stop-daemon --stop --quiet --pidfile $PIDFILE_UWEB -m --retry TERM/1/TERM/1/KILL
57 *) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"