Debian Codegraph @

setup/files/SUSE/SUSE11.3/firstboot.SUSE11.3.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 ! type sax2 &>/dev/null; then
38 echo "Sax2 not found! Skip configuring X config."
39 exit 3
40 fi
41 if grep -i reconfig /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then
42 echo "Running system reconfiguration tool"
43 sax2
44 rm -f /etc/reconfigSys
45 exit 0
46 fi
47
48 runlevel=$(set -- $(runlevel); eval "echo \$$#" )
49 # DRBL, no matter runlevel 5 in /etc/inittab or now in runlevel 5
50 if grep -q "^id:5:initdefault:" /etc/inittab || [ "x$runlevel" = x5 ]; then
51 if [ ! -f /etc/X11/xorg.conf ] ; then
52 echo "X is not configured. Running configure program..."
53 sax2
54 echo "X is now configured."
55 fi
56 fi
57 exit 0
58 ;;
59 esac