Shellcheck compliance

Fixes Shell check SC2086 errors, missing ""
This commit is contained in:
4s3ti 2021-11-02 16:34:50 +01:00
parent 0883893a4f
commit 1fa467d9fd

View file

@ -621,7 +621,7 @@ fi
if [ "${runUnattended}" = 'true' ]; then if [ "${runUnattended}" = 'true' ]; then
if [ -z "$IPv4dev" ]; then if [ -z "$IPv4dev" ]; then
if [ $interfaceCount -eq 1 ]; then if [ "$interfaceCount" -eq 1 ]; then
IPv4dev="${availableInterfaces}" IPv4dev="${availableInterfaces}"
echo "::: No interface specified, but only ${IPv4dev} is available, using it" echo "::: No interface specified, but only ${IPv4dev} is available, using it"
else else
@ -1790,8 +1790,8 @@ askEncryption(){
cidrToMask(){ cidrToMask(){
# Source: https://stackoverflow.com/a/20767392 # Source: https://stackoverflow.com/a/20767392
set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0 set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
shift $1 shift "$1"
echo ${1-0}.${2-0}.${3-0}.${4-0} echo "${1-0}"."${2-0}"."${3-0}"."${4-0}"
} }
confOpenVPN(){ confOpenVPN(){
@ -1917,12 +1917,12 @@ set_var EASYRSA_ALGO ${pivpnCERT}" | $SUDO tee vars >/dev/null
$SUDO install -m 644 "$pivpnFilesDir"/files/etc/openvpn/server_config.txt /etc/openvpn/server.conf $SUDO install -m 644 "$pivpnFilesDir"/files/etc/openvpn/server_config.txt /etc/openvpn/server.conf
# Apply client DNS settings # Apply client DNS settings
${SUDOE} sed -i '0,/\(dhcp-option DNS \)/ s/\(dhcp-option DNS \).*/\1'${pivpnDNS1}'\"/' /etc/openvpn/server.conf ${SUDOE} sed -i '0,/\(dhcp-option DNS \)/ s/\(dhcp-option DNS \).*/\1'"${pivpnDNS1}"'\"/' /etc/openvpn/server.conf
if [ -z ${pivpnDNS2} ]; then if [ -z "${pivpnDNS2}" ]; then
${SUDOE} sed -i '/\(dhcp-option DNS \)/{n;N;d}' /etc/openvpn/server.conf ${SUDOE} sed -i '/\(dhcp-option DNS \)/{n;N;d}' /etc/openvpn/server.conf
else else
${SUDOE} sed -i '0,/\(dhcp-option DNS \)/! s/\(dhcp-option DNS \).*/\1'${pivpnDNS2}'\"/' /etc/openvpn/server.conf ${SUDOE} sed -i '0,/\(dhcp-option DNS \)/! s/\(dhcp-option DNS \).*/\1'"${pivpnDNS2}"'\"/' /etc/openvpn/server.conf
fi fi
# Set the user encryption key size # Set the user encryption key size