Debian Codegraph @

setup/files/SUSE/firstboot.default-SUSE.drbl

raw
1 #!/bin/bash
2 #
3 # firstboot: Starts the firstboot X config
4 ### BEGIN INIT INFO
5 # Provides: firstboot
6 # Required-Start: nfs
7 # Should-Start: kbd haldaemon
8 # Required-Stop:
9 # Default-Start: 5
10 # Default-Stop:
11 # Description: Config X
12 ### END INIT INFO
13 #
14 # chkconfig: 5 29 95
15 #
16 # description: Configure the X config.
17 # If /etc/reconfigSys exists, run the reconfiguration
18 # program and remove /etc/reconfigSys when done.
19 # Also will run if 'reconfig' is on the kernel cmdline.
20 #
21 # Modified by Steven Shiau <steven _at_ clonezilla org> to use in
22 # DRBL for SuSE 2005/7/31
23 #
24
25 # load the display setting
26 . /etc/sysconfig/displaymanager
27 default_dm="$DISPLAYMANAGER"
28 # if default_dm is unset, exit
29 [ -z "$default_dm" ] && echo "Default DM is unset! Skip firstboot!" && exit 0
30
31 case "$1" in
32 restart)
33 [ -f /etc/X11/xorg.conf ] && rm -f /etc/X11/xorg.conf
34 $0 start
35 ;;
36 start)
37 if grep -i reconfig /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then
38 echo "Running system reconfiguration tool"
39 sax2
40 rm -f /etc/reconfigSys
41 exit 0
42 fi
43
44 runlevel=$(set -- $(runlevel); eval "echo \$$#" )
45 # DRBL, no matter runlevel 5 in /etc/inittab or now in runlevel 5
46 if grep -q "^id:5:initdefault:" /etc/inittab || [ "x$runlevel" = x5 ]; then
47 if [ ! -f /etc/X11/xorg.conf ] ; then
48 echo "X is not configured. Running configure program..."
49 sax2
50 echo "X is now configured."
51 fi
52 fi
53 exit 0
54 ;;
55 esac