Fix shellcheck warnings
This commit is contained in:
parent
53f14989b8
commit
64689ce065
1 changed files with 13 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
function fold () { /usr/bin/fold --spaces --width=$(tput cols); }
|
function fold () { /usr/bin/fold --spaces --width="$(tput cols)"; }
|
||||||
|
|
||||||
function _urlify-1 ()
|
function _urlify-1 ()
|
||||||
{
|
{
|
||||||
|
@ -13,17 +13,22 @@ function _urlify-1 ()
|
||||||
|
|
||||||
function urlify ()
|
function urlify ()
|
||||||
{
|
{
|
||||||
local uitems=($(_urlify-1 $@))
|
local uitems=($(_urlify-1 "$@"))
|
||||||
local IFS="&"
|
local IFS="&"
|
||||||
echo "${uitems[*]}"
|
echo "${uitems[*]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function make-url ()
|
function make-url ()
|
||||||
{
|
{
|
||||||
local countryparams=$(urlify country ${countries[@]})
|
local countryparams
|
||||||
local protocolparams=$(urlify protocol ${protocols[@]})
|
local protocolparams
|
||||||
local ipparams=$(urlify ip_version ${ip_versions[@]})
|
local ipparams
|
||||||
local statusparams=$(urlify use_mirror_status $use_mirror_status)
|
local statusparams
|
||||||
|
|
||||||
|
countryparams=$(urlify country "${countries[@]}")
|
||||||
|
protocolparams=$(urlify protocol "${protocols[@]}")
|
||||||
|
ipparams=$(urlify ip_version "${ip_versions[@]}")
|
||||||
|
statusparams=$(urlify use_mirror_status "$use_mirror_status")
|
||||||
|
|
||||||
echo "${url}/?${countryparams}&${protocolparams}&${ipparams}&${statusparams}"
|
echo "${url}/?${countryparams}&${protocolparams}&${ipparams}&${statusparams}"
|
||||||
}
|
}
|
||||||
|
@ -35,7 +40,7 @@ function load-global-config ()
|
||||||
for dir in $1; do
|
for dir in $1; do
|
||||||
local cfgfile="${dir}${2}"
|
local cfgfile="${dir}${2}"
|
||||||
if [[ -x $cfgfile ]]; then
|
if [[ -x $cfgfile ]]; then
|
||||||
source $cfgfile
|
source "$cfgfile"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -49,7 +54,7 @@ cfgfile="/update-mirrors/config.sh"
|
||||||
if [[ -x "${cfgbase}${cfgfile}" ]]; then
|
if [[ -x "${cfgbase}${cfgfile}" ]]; then
|
||||||
source "${cfgbase}${cfgfile}"
|
source "${cfgbase}${cfgfile}"
|
||||||
else
|
else
|
||||||
load-global-config $etcbases $cfgfile
|
load-global-config "$etcbases" $cfgfile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check destination
|
# Check destination
|
||||||
|
|
Loading…
Reference in a new issue