#!/bin/sh
### BEGIN INIT INFO
# Provides:          phonefsod
# Required-Start:    dbus $remote_fs
# Required-Stop:     dbus $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: SHR Phone FSO daemon
# Description:       phonefsod is the connection between phoneuid and
#                    the services specified by freesmartphone.org
### END INIT INFO

PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=phonefsod
DESC="SHR Phone FSO daemon"

. /lib/lsb/init-functions

case "$1" in
	start)
		log_daemon_msg "Starting $DESC" "$NAME"
		start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid --exec /usr/sbin/${NAME}
		log_end_msg $?
		;;
	stop)
		log_daemon_msg "Stopping $DESC" "$NAME"
		start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid
		log_end_msg $?
		;;
	restart|force-reload)
		$0 stop
		$0 start
		;;
	*)
		echo "Usage: $0 {start|stop|restart|force-reload}"
		exit 1
		;;
esac

exit 0
