]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/installer/dracut-module/run-installer.sh
installer: Power off instead of reboot after unattended install
[ipfire-2.x.git] / src / installer / dracut-module / run-installer.sh
index 1a7bd137214afdcf020b98510fc2e5ba9e303a46..ea9669a86cfc40084426f5f9be552bcc86c4e37a 100644 (file)
@@ -3,6 +3,11 @@
 # IPFire Installer RC
 #
 
+unattended=0
+if grep -q "installer.unattended" /proc/cmdline; then
+       unattended=1
+fi
+
 # Enable Unicode
 echo -en '\033%G' && kbd_mode -u
 
@@ -22,14 +27,16 @@ echo "Loading Installer..."
 ret=$?
 
 case "${ret}" in
-       0)
-               # The installer has finished without a problem.
-               ;;
-       *)
+       139)
                echo "The installer has crashed. You will be dropped to a debugging shell"
                /bin/bash --login
                ;;
 esac
 
+# Poweroff after an unattended installation
+if [ "${unattended}" = "1" ]; then
+       /shutdown poweroff
+fi
+
 # Reboot the system
 /shutdown reboot