40-x11-autostart 454 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh

if [ ! -x /usr/bin/X ]; then
	echo "SKIP autostart: X not installed" >&2
	exit 0
fi

## setup automated graphical session startup
INITTAB=/etc/inittab
if [ -f "$INITTAB" ]; then
	[ -z "$runlevel" ] && runlevel=5
	sed -i "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
fi

## ...and systemd, if any
16 17
## NB: alterator-setup's backup file can present a nice catch if left around
rm -f /etc/systemd/system/default.target{,.bak}
18 19

: