From 6dad3eb2bbe3901a85f060908ca77dfb221f42a5 Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Thu, 14 Jul 2011 09:49:46 -0700 Subject: Bugfix 5856: Add username and password options. In order to allow username and password parameters in the corresponding op mode command, we allow username and password to be specified on the install-image command line. --- scripts/install/install-image | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts/install') diff --git a/scripts/install/install-image b/scripts/install/install-image index fd4fee7d..5abef7ca 100755 --- a/scripts/install/install-image +++ b/scripts/install/install-image @@ -56,8 +56,14 @@ fetch_iso_by_url () mkdir $TEMP_DIR echo "Trying to fetch ISO file from $NEW_ISO" + if [ -n "$USERNAME" ]; then + auth="-u $USERNAME:$PASSWORD" + else + auth="" + fi + filename="${TEMP_DIR}/${NEW_ISO##*/}" - curl -f -o $filename $NEW_ISO + curl $auth -f -o $filename $NEW_ISO if [ $? -ne 0 ]; then echo "Unable to fetch ISO from $NEW_ISO" rm -f $filename @@ -203,6 +209,15 @@ install_existing () # running system. NEW_ISO=$1 +# Username and password are optional +if [ $# -eq 3 ]; then + USERNAME=$2 + PASSWORD=$3 +else + USERNAME="" + PASSWORD="" +fi + if [ `whoami` != 'root' ] ; then fail_exit 'This script must be run with root privileges.' fi -- cgit v1.2.3