[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-knoppix] [PATCH] "noprompt" cheatcode, patch for sysvinit-knoppix/knoppix-halt



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

attached patch adds noprompt cheatcode.

cu

Fabian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE/ItpoI0lSH7CXz7MRAkEWAJ43NN6YTE0i9g7aF58U1d14r3s13ACePV9l
wa/GihXvEBFuZgjfbFiDP3Y=
=W07l
-----END PGP SIGNATURE-----
--- /etc/init.d/knoppix-halt	2003-01-17 20:55:12.000000000 +0100
+++ knoppix-halt	2003-07-25 00:28:45.000000000 +0200
@@ -92,8 +92,13 @@
 
 # Note: This needs the KNOPPIX version of static "init" which contains
 # the "halt" command plus rmmod/umount calls
+NOPROMPT=""
+read CMDLINE <<EOT
+$(cat /proc/cmdline 2>/dev/null)
+EOT
+case "$CMDLINE" in *noprompt*) NOPROMPT="yes"; ;; esac
 FINALCMD="/sbin/$command"
-if [ -z "$INSTALLED" ]; then
+if [ -z "$INSTALLED" -a -z "$NOMPROMPT" ]; then
 [ -x /etc/init ] || cp -p /sbin/init /etc/
 [ -x /etc/init ] && FINALCMD="/etc/init"
 fi

Reply to: