diff options
author | David-John Willis <John.Willis@Distant-earth.com> | 2012-04-24 14:02:52 +0100 |
---|---|---|
committer | David-John Willis <John.Willis@Distant-earth.com> | 2012-04-24 14:02:52 +0100 |
commit | c20be94e434ea2eb2a0147e61b433585bcbf6913 (patch) | |
tree | 3ddbe72803bc9f67a3e879a378638b073726f801 /recipes-extra/startup/rpi-first-run-wizard/rc.firstrun | |
parent | 03eef509e4aa5aae05326410fb9f9fdfcf433f48 (diff) | |
download | meta-raspberrypi-c20be94e434ea2eb2a0147e61b433585bcbf6913.tar.gz |
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.
Diffstat (limited to 'recipes-extra/startup/rpi-first-run-wizard/rc.firstrun')
-rw-r--r-- | recipes-extra/startup/rpi-first-run-wizard/rc.firstrun | 73 |
1 files changed, 73 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: rpiruninit | ||
5 | # Required-Start: #adjust | ||
6 | # Required-Stop: #adjust | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: 0 1 6 | ||
9 | ### END INIT INFO | ||
10 | |||
11 | DESC="Raspberry Pi Startup Script Deamon" | ||
12 | NAME="rpiruninit" | ||
13 | |||
14 | PID=`pidof -o %PPID -x rpi_startup.sh` | ||
15 | OPRUNINIT='/usr/rpi/scripts/rpi_startup.sh' | ||
16 | |||
17 | d_stop() { | ||
18 | if [ $PID ] | ||
19 | then | ||
20 | kill $PID | ||
21 | else | ||
22 | echo "$DESC: $NAME not running." | ||
23 | fi | ||
24 | } | ||
25 | |||
26 | d_start() { | ||
27 | if [ $PID ] | ||
28 | then | ||
29 | echo "$DESC: $NAME already running." | ||
30 | else | ||
31 | $OPRUNINIT | ||
32 | fi | ||
33 | } | ||
34 | |||
35 | d_reload() { | ||
36 | if [ $PID ] | ||
37 | then | ||
38 | kill -HUP $PID | ||
39 | else | ||
40 | echo "$DESC: $NAME not running." | ||
41 | fi | ||
42 | } | ||
43 | |||
44 | case "$1" in | ||
45 | start) | ||
46 | echo -n "Starting $DESC: $NAME" | ||
47 | d_start | ||
48 | echo "." | ||
49 | ;; | ||
50 | stop) | ||
51 | echo -n "Stopping $DESC: $NAME" | ||
52 | d_stop | ||
53 | echo "." | ||
54 | ;; | ||
55 | reload) | ||
56 | echo -n "Reloading $DESC: $NAME" | ||
57 | d_reload | ||
58 | echo "." | ||
59 | ;; | ||
60 | restart|force-reload) | ||
61 | echo -n "Restarting $DESC: $NAME" | ||
62 | d_stop | ||
63 | sleep 1 | ||
64 | d_start | ||
65 | echo "." | ||
66 | ;; | ||
67 | *) | ||
68 | echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 | ||
69 | exit 1 | ||
70 | ;; | ||
71 | esac | ||
72 | |||
73 | exit 0 | ||