#!/bin/bash # Try to read default runlevel from the old inittab if it exists runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null) if [ -n "$runlevel" -a -e /lib/systemd/system/runlevel$runlevel.target ] ; then /bin/ln -sf /lib/systemd/system/runlevel$runlevel.target $1/default.target 2>&1 && exit 0 fi #failsafe /bin/ln -sf /lib/systemd/system/graphical.target $1/default.target