24 lines
1.0 KiB
Plaintext
24 lines
1.0 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
IS_GRAPHICAL="$(rpm -q initial-setup-gui >/dev/null 2>&1 && echo "yes" || echo "no")"
|
||
|
WINDOWMANAGER_SCRIPT="/usr/bin/firstboot-windowmanager"
|
||
|
INITIAL_SETUP_SCRIPT="/usr/bin/initial-setup"
|
||
|
|
||
|
# check if graphical Initial Setup is installed
|
||
|
if test "x${IS_GRAPHICAL}" = "xyes"; then
|
||
|
printf "MESSAGE=starting Initial Setup GUI\nPRIORITY=6" | logger --journald
|
||
|
/bin/xinit ${WINDOWMANAGER_SCRIPT} ${INITIAL_SETUP_SCRIPT} -- /bin/Xorg :9 -ac -nolisten tcp
|
||
|
else
|
||
|
printf "MESSAGE=starting Initial Setup TUI\nPRIORITY=6" | logger --journald
|
||
|
${INITIAL_SETUP_SCRIPT}
|
||
|
fi
|
||
|
|
||
|
# check if the Initial Setup run was successful by looking at the return code
|
||
|
if [ $? -eq 0 ]; then
|
||
|
printf "MESSAGE=Initial Setup finished successfully, disabling\nPRIORITY=6" | logger --journald
|
||
|
/bin/systemctl disable initial-setup.service &>/dev/null
|
||
|
printf "MESSAGE=Initial Setup has been disabled\nPRIORITY=6" | logger --journald
|
||
|
else
|
||
|
printf "MESSAGE=Initial Setup failed, keeping enabled\nPRIORITY=3" | logger --journald
|
||
|
fi
|