• Michael Shigorin's avatar
    x11-autostart: tweak for oem case · fc3569a4
    Michael Shigorin authored
    The nuance being that:
    - alterator-setup package would change default.target
      for systemd providing a symlink of its own and making
      a backup of what was there (rc3 basically);
    - 40-x11-autostart would ignore that backup;
    - 99-oem-setup would do nothing about it all either;
    - alterator-setup removal would restore rc3 symlink.
    
    It's not pretty either, something more robust should be
    invented some day.
    fc3569a4
40-x11-autostart 454 Bytes
#!/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
## NB: alterator-setup's backup file can present a nice catch if left around
rm -f /etc/systemd/system/default.target{,.bak}

: