diff --git a/init.sh b/init.sh index ab1a905..ecc6aed 100755 --- a/init.sh +++ b/init.sh @@ -86,6 +86,7 @@ read_commandline $@ # (--help and --version are allowed as unprivileged user) check_root +# ------------------------------------------------------------------------------ # Logfile variable treatment -- cannot be a function if [[ -n $NEW_LOGFILE ]]; then @@ -113,6 +114,7 @@ else fi # -- Cannot be a function ends here +# ------------------------------------------------------------------------------ load_autoconf @@ -120,11 +122,7 @@ load_configuration process_commandline_and_vars -# Declare proxy system vars if needed and if not already declared -if [[ -n $PROXYSRV && -n $PROXYSRVPORT && -z $NO_PROXY ]]; then - export http_proxy=${http_proxy:-"http://$PROXYSRV:$PROXYSRVPORT/"} - export https_proxy=${https_proxy:-"http://$PROXYSRV:$PROXYSRVPORT/"} -fi +set_system_proxy # Reinit stage file if no resuming if [[ $RESUME != true ]]; then @@ -203,7 +201,7 @@ fi echo -e "${BYellow}Si vous continuez après cette étape le système sera modifié !${DEFAULTCOL}" echo -while read -r -t 0.001; do :; done # Dump the buffer +dump_key_buffer read -n 1 -rsp $"Appuyer sur la touche pour continuer ou une autre pour s'arrêter..." key echo diff --git a/lib/display.sh b/lib/display.sh index f9ae3d8..f4b608d 100644 --- a/lib/display.sh +++ b/lib/display.sh @@ -90,7 +90,8 @@ export On_IWhite='\e[0;107m' # Display status with color and timestamp # ($1 accepted values: I=info, W=warning, E=error, m=des espaces (allignement) # no header if anything else) -prnt() { +prnt() +{ case $1 in "I") local heads="[ ${IGreen}info${DEFAULTFG} ]" @@ -115,4 +116,15 @@ prnt() { } export -f prnt + +# ------------------------------------------------------------------------------ +# Dump the keyboard's buffer +dump_key_buffer() +{ + while read -r -t 0.001; do + : + done +} +export -f dump_key_buffer + # EOF diff --git a/lib/support.sh b/lib/support.sh index 96d18f7..1453596 100644 --- a/lib/support.sh +++ b/lib/support.sh @@ -111,4 +111,17 @@ get_mod_name() } export -f get_mod_name + +# ------------------------------------------------------------------------------ +# Set system proxy vars +set_system_proxy() +{ + # Declare proxy system vars if needed and if not already declared + if [[ -n $PROXYSRV && -n $PROXYSRVPORT && -z $NO_PROXY ]]; then + export http_proxy=${http_proxy:-"http://$PROXYSRV:$PROXYSRVPORT/"} + export https_proxy=${https_proxy:-"http://$PROXYSRV:$PROXYSRVPORT/"} + fi +} +export -f set_system_proxy + # EOF