Get vars from env for fetch_os_creds.sh
[releng.git] / utils / fetch_os_creds.sh
index 48498b7..cd53dac 100755 (executable)
@@ -52,12 +52,16 @@ while getopts ":d:i:a:h:" optchar; do
     esac
 done
 
+# set vars from env if not provided by user as options
+dest_path=${dest_path:-$HOME/opnfv-openrc.sh}
+installer_type=${installer_type:-$INSTALLER_TYPE}
+installer_ip=${installer_ip:-$INSTALLER_IP}
+
 if [ -z $dest_path ] || [ -z $installer_type ] || [ -z $installer_ip ]; then
     usage
     exit 2
 fi
 
-
 # Checking if destination path is valid
 if [ -d $dest_path ]; then
     error "Please provide the full destination path for the credentials file including the filename"