externalise in libs: dump_key_buffer and set_system_proxy

This commit is contained in:
levasseur
2021-10-08 17:16:02 +02:00
parent 31a2d2bce8
commit a5975307dd
3 changed files with 30 additions and 7 deletions

View File

@@ -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

View File

@@ -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