[Ovirt-devel] [PATCH node] Changes the exit/continue based on context.
Joey Boggs
jboggs at redhat.com
Wed Jul 22 17:13:14 UTC 2009
Darryl L. Pierce wrote:
> If the script is run during the system startup then it says "Continue
> with stateless boot".
>
> If the script is run from the command line then it says "Quite and
> Exit".
>
> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
> ---
> scripts/ovirt-config-setup | 22 ++++++++++++++++++++--
> scripts/ovirt-firstboot | 2 +-
> 2 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup
> index ee78254..4010828 100755
> --- a/scripts/ovirt-config-setup
> +++ b/scripts/ovirt-config-setup
> @@ -10,7 +10,6 @@ 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"
>
> declare -a OPTIONS
>
> @@ -32,13 +31,32 @@ for cfg in $CONFIG_DIR/*; do
> fi
> done
> OPTIONS[${#OPTIONS[*]}]="$DEBUG_SHELL"
> -OPTIONS[${#OPTIONS[*]}]="$CONTINUE"
>
>
> # reset tty, otherwise serial console is broken
> reset > /dev/null
> clear
>
> +# set defaults
> +has_continue_option=false
> +
> +while getopts x c; do
> + case $c in
> + x) has_continue_option=true;;
> + '?') die "invalid option \`-$OPTARG'";;
> + :) die "missing argument to \`-$OPTARG' option";;
> + *) die "internal error";;
> + esac
> +done
> +
> +if $has_continue_option; then
> + CONTINUE="Continue Stateless Boot"
> +else
> + CONTINUE="Quit And Exit"
> +fi
> +OPTIONS[${#OPTIONS[*]}]="$CONTINUE"
> +
> +
> while true; do
> PS3="Please select an option: "
>
> diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot
> index 844f689..4160e63 100755
> --- a/scripts/ovirt-firstboot
> +++ b/scripts/ovirt-firstboot
> @@ -55,7 +55,7 @@ start ()
> elif is_firstboot; then
> plymouth --hide-splash
>
> - ovirt-config-setup < /dev/console
> + ovirt-config-setup -x < /dev/console
>
> plymouth --show-splash
> fi
>
ack
More information about the ovirt-devel
mailing list