File: debian-edu-install.xdebian-edu-firstboot.init

package info (click to toggle)
debian-edu-install 2.12.11
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,048 kB
  • sloc: sh: 1,263; makefile: 105
file content (70 lines) | stat: -rwxr-xr-x 2,007 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
### BEGIN INIT INFO
# Provides:          xdebian-edu-firstboot
# Required-Start:    $remote_fs $all
# Required-Stop:
# Should-Start:      $x-display-manager xdm kdm gdm wdm slim lightdm
# Default-Start:     2 3 4 5
# Default-Stop:
# X-Interactive:     true
# Short-Description: Check the Debian Edu installation after first boot
# Description:       Run the self test and report any errors found.
#                    Install this as /etc/rc2.d/99xdebian-edu-firstboot
### END INIT INFO
#
# Author: Petter Reinholdtsen
# Date:   2006-09-22
#

# only run if package is installed (debian policy 9.3.2)
test -f /usr/lib/debian-edu-install/version || exit 0

. /lib/lsb/init-functions

firstboot_file=/etc/debian-edu/xdebian-edu-firstboot

set -e

do_start() {
    logger -t debian-edu-install "Executing xdebian-edu-firstboot"

    # The parts updating LTSP and readahead was moved to
    # debian-edu-config, this hook made it possible.
    if [ -x /usr/share/debian-edu-config/tools/run-at-firstboot ] ; then
	log_begin_msg "Running debian-edu-config run-at-firstboot"
	/usr/share/debian-edu-config/tools/run-at-firstboot
	log_end_msg 0 || true
    fi

    # Create firstboot file to prevent it from being run again
    touch "$firstboot_file"

    # only run the testsuite and report errors if requested via kernel
    # command line param 'testinstall'.
    if [ -f /etc/debian-edu/config ] ; then . /etc/debian-edu/config ; fi
    if [ true = "$TESTINSTALL" ]; then
	log_begin_msg "Collecting testsuite results"
	/usr/share/debian-edu-install/debian-edu-testsuite
	log_end_msg $? || true
    else
	log_begin_msg "Not collecting testsuite results"
	log_end_msg 0 || true
    fi
}

case "$1" in
    start)
        if [ ! -f "$firstboot_file" ]; then
            do_start
        fi
        ;;
    stop|force-reload|restart)
        ;;
    *)
        echo "Usage: /etc/init.d/xdebian-edu-firstboot {start|stop|restart|force-reload}"
        disable_exception
        exit 1
        ;;
esac

exit 0