added network functions to new net.sh lib, moved set_system_proxy, begin of offline mode implementation

This commit is contained in:
2022-09-07 21:19:42 +02:00
parent da37fd3bae
commit 5e44ebebd5
4 changed files with 188 additions and 9 deletions

View File

@@ -8,7 +8,6 @@
# https://opensource.org/licenses/BSD-3-Clause
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Define normalised time display, filename friendly
stdtime()
@@ -49,15 +48,13 @@ export -f get_mod_name
# ------------------------------------------------------------------------------
# Set system proxy vars
set_system_proxy()
# Remove leading and trailing space of the given parameter
trim()
{
# Declare proxy system vars if needed and if not already declared
if [[ -n $PROXY_SRV && -n $PROXY_SRV_PORT && -z $NO_PROXY ]]; then
export http_proxy=${http_proxy:-"http://$PROXY_SRV:$PROXY_SRV_PORT/"}
export https_proxy=${https_proxy:-"http://$PROXY_SRV:$PROXY_SRV_PORT/"}
fi
local string="$@"
echo "$(sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'<<<"${string}")"
unset string
}
export -f set_system_proxy
export -f trim
# EOF