added network functions to new net.sh lib, moved set_system_proxy, begin of offline mode implementation
This commit is contained in:
15
lib/utils.sh
15
lib/utils.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user