Shellcheck compliance

scripts/uninstall.sh
  * SC2154: <VarName> is referenced but not assigned.
  * Disabled warnings for mentioned errors as they are sourced externaly and may vary
This commit is contained in:
4s3ti 2021-11-02 17:08:27 +01:00
parent 8598013294
commit 57cc772d18

View file

@ -61,7 +61,7 @@ if [ ! -f "${setupVars}" ]; then
echo "::: Missing setup vars file!" echo "::: Missing setup vars file!"
exit 1 exit 1
fi fi
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "${setupVars}" source "${setupVars}"
@ -97,9 +97,11 @@ removeAll(){
if [ "$USING_UFW" -eq 1 ]; then if [ "$USING_UFW" -eq 1 ]; then
### FIXME: SC2154 ### Ignoring SC2154, value sourced from setupVars file
# shellcheck disable=SC2154
ufw delete allow "${pivpnPORT}"/"${pivpnPROTO}" > /dev/null ufw delete allow "${pivpnPORT}"/"${pivpnPROTO}" > /dev/null
### FIXME: SC2154 ### Ignoring SC2154, value sourced from setupVars file
# shellcheck disable=SC2154
ufw route delete allow in on "${pivpnDEV}" from "${pivpnNET}/${subnetClass}" out on "${IPv4dev}" to any > /dev/null ufw route delete allow in on "${pivpnDEV}" from "${pivpnNET}/${subnetClass}" out on "${IPv4dev}" to any > /dev/null
sed "/-I POSTROUTING -s ${pivpnNET}\\/${subnetClass} -o ${IPv4dev} -j MASQUERADE -m comment --comment ${VPN}-nat-rule/d" -i /etc/ufw/before.rules sed "/-I POSTROUTING -s ${pivpnNET}\\/${subnetClass} -o ${IPv4dev} -j MASQUERADE -m comment --comment ${VPN}-nat-rule/d" -i /etc/ufw/before.rules
iptables -t nat -D POSTROUTING -s "${pivpnNET}/${subnetClass}" -o "${IPv4dev}" -j MASQUERADE -m comment --comment "${VPN}-nat-rule" iptables -t nat -D POSTROUTING -s "${pivpnNET}/${subnetClass}" -o "${IPv4dev}" -j MASQUERADE -m comment --comment "${VPN}-nat-rule"
@ -199,7 +201,8 @@ removeAll(){
rm -f /etc/wireguard/wg0.conf rm -f /etc/wireguard/wg0.conf
rm -rf /etc/wireguard/configs rm -rf /etc/wireguard/configs
rm -rf /etc/wireguard/keys rm -rf /etc/wireguard/keys
### FIXME SC2154 ### Ignoring SC2154, value sourced from setupVars file
# shellcheck disable=SC2154
rm -rf "$install_home/configs" rm -rf "$install_home/configs"
elif [ "$VPN" = "openvpn" ]; then elif [ "$VPN" = "openvpn" ]; then
rm -rf /var/log/*openvpn* rm -rf /var/log/*openvpn*