meta-raspberrypi/recipes-extra/startup/rpi-first-run-wizard/rc.firstrun
David-John Willis c20be94e43 rpi-first-run-wizard: Add basic first run wizard from the OpenPandora.
* Only used in demo images at the moment to just get a user setup.
2012-04-24 14:02:52 +01:00

74 lines
1.0 KiB
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: rpiruninit
# Required-Start: #adjust
# Required-Stop: #adjust
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
DESC="Raspberry Pi Startup Script Deamon"
NAME="rpiruninit"
PID=`pidof -o %PPID -x rpi_startup.sh`
OPRUNINIT='/usr/rpi/scripts/rpi_startup.sh'
d_stop() {
if [ $PID ]
then
kill $PID
else
echo "$DESC: $NAME not running."
fi
}
d_start() {
if [ $PID ]
then
echo "$DESC: $NAME already running."
else
$OPRUNINIT
fi
}
d_reload() {
if [ $PID ]
then
kill -HUP $PID
else
echo "$DESC: $NAME not running."
fi
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;
reload)
echo -n "Reloading $DESC: $NAME"
d_reload
echo "."
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
d_stop
sleep 1
d_start
echo "."
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0