summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install/install-image17
1 files changed, 16 insertions, 1 deletions
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