[Ovirt-devel] [PATCH node] Changes the exit prompt based on whether it's firstboot of cmdline.

Darryl L. Pierce dpierce at redhat.com
Tue Jul 14 20:05:25 UTC 2009


If the menu is launched during firstboot then the menu shows the
"Continue with stateless boot" text. If the menu is launched from the
cmdline then it will show "Exit".

Resolves: rhbz#511122

Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 scripts/ovirt-config-setup |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup
index ee78254..105f7bc 100755
--- a/scripts/ovirt-config-setup
+++ b/scripts/ovirt-config-setup
@@ -10,7 +10,23 @@ CONFIG_DIR=/etc/ovirt-config-setup.d
 
 # special options, all others execute the symlinked script in CONFIG_DIR
 DEBUG_SHELL="Shell"
-CONTINUE="Continue Stateless Boot"
+
+during_firstboot=true
+for tty in $(ps -ef | awk '{ printf $2"::"$6" " '}); do
+    if [[ "$tty" =~ "$$::" ]]; then
+	len=${#$}
+	the_tty=${tty:len+2}
+	if [ "$the_tty" != "?" ]; then
+	    during_firstboot=false
+	fi
+    fi
+done
+
+if $during_firstboot; then
+    CONTINUE="Continue Stateless Boot"
+else
+    CONTINUE="Exit Setup Menu"
+fi
 
 declare -a OPTIONS
 
-- 
1.6.2.5




More information about the ovirt-devel mailing list