From c20be94e434ea2eb2a0147e61b433585bcbf6913 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Tue, 24 Apr 2012 14:02:52 +0100 Subject: 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. --- .../startup/rpi-first-run-wizard/rc.firstrun | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 recipes-extra/startup/rpi-first-run-wizard/rc.firstrun (limited to 'recipes-extra/startup/rpi-first-run-wizard/rc.firstrun') diff --git a/recipes-extra/startup/rpi-first-run-wizard/rc.firstrun b/recipes-extra/startup/rpi-first-run-wizard/rc.firstrun new file mode 100644 index 0000000..2bc91aa --- /dev/null +++ b/recipes-extra/startup/rpi-first-run-wizard/rc.firstrun @@ -0,0 +1,73 @@ +#!/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 -- cgit v1.2.3-54-g00ecf