Read user params after reading script parameters
Script parameters should be read before any
user prompt in order to handle the `-h` flag
in a correct way.
@@ -12,12 +12,6 @@ LOG_LEVEL_DEFAULT="info"
CONFIG_DIR_PATH_DEFAULT="$RELAY_PATH/config"
CONFIG_DIR_PATH=$(realpath "${CONFIG_DIR_PATH:-$CONFIG_DIR_PATH_DEFAULT}")
-# Read user inputs.
-OPERATOR_KEY_FILE_PASSWORD_DEFAULT=password
-read -p "Enter operator key file \
-password [$OPERATOR_KEY_FILE_PASSWORD_DEFAULT]: " operator_password
-OPERATOR_KEY_FILE_PASSWORD=${operator_password:-$OPERATOR_KEY_FILE_PASSWORD_DEFAULT}
-
help()
{
echo -e "\nUsage: ENV_VAR(S) $0"
@@ -35,6 +29,12 @@ do
esac
done
+# Read user inputs.
+OPERATOR_KEY_FILE_PASSWORD_DEFAULT=password
+read -p "Enter operator key file \
+password [$OPERATOR_KEY_FILE_PASSWORD_DEFAULT]: " operator_password
+OPERATOR_KEY_FILE_PASSWORD=${operator_password:-$OPERATOR_KEY_FILE_PASSWORD_DEFAULT}
+
config_files=($CONFIG_DIR_PATH/*.toml)
config_files_count=${#config_files[@]}
while :
