[Ovirt-devel] [PATCH node] allow o-c-password to set admin password

Mike Burns mburns at redhat.com
Mon Aug 22 14:12:55 UTC 2011


Provides a way to set the admin password if the adminpw option was
omitted from autoinstall options

rhbz#725984

Signed-off-by: Mike Burns <mburns at redhat.com>
---
 scripts/ovirt-config-password |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password
index fea4efa..6405f7c 100755
--- a/scripts/ovirt-config-password
+++ b/scripts/ovirt-config-password
@@ -39,12 +39,13 @@ function prompt_sasl_user {

 set_password () {
     printf "\n\n Password Configuration\n\n"
+    local user=${1-root}

     # prompt user
     # Set the password for the root user first
-    printf "\nSystem Administrator (root):\n"
+    printf "\nSystem Administrator ($user):\n"
     unmount_config /etc/shadow
-    passwd root
+    passwd $user
     ovirt_store_config /etc/shadow
 }

@@ -69,7 +70,8 @@ toggle_ssh () {
     fi
 }

-PASSWORD="Set administrator password"
+PASSWORD="Set root password"
+ADMIN_PASSWORD="Set admin user password"
 SSH="Toggle SSH password authentication"
 QUIT="Quit and Return To Menu"

@@ -87,10 +89,11 @@ else
 	printf "\nSSH password authentication is currently ${state}.\n\n"

 	PS3="Please select an option: "
-	select option in "$PASSWORD" "$SSH" "$QUIT"
+	select option in "$PASSWORD" "$ADMIN_PASSWORD" "$SSH" "$QUIT"
 	do
             case $option in
 		$PASSWORD) set_password; break;;
+		$ADMIN_PASSWORD) set_password admin; break;;
 		$SSH) toggle_ssh; break;;
 		$QUIT) exit;;
             esac
-- 
1.7.4.4




More information about the ovirt-devel mailing list