From 8130dc7b70d6df28423b948af4de61cc172f0bd6 Mon Sep 17 00:00:00 2001 From: Stanislas Lange Date: Sat, 21 Mar 2020 21:53:06 +0100 Subject: [PATCH] Fix shellcheck --- .github/workflows/push.yml | 2 +- wireguard-install.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 7c67b74..33edafa 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,6 +8,6 @@ jobs: - name: shellcheck uses: ludeeus/action-shellcheck@0.0.1 env: - SHELLCHECK_OPTS: -e SC1091,SC1117 + SHELLCHECK_OPTS: -e SC1091,SC1117,SC2001 with: args: wireguard-install.sh diff --git a/wireguard-install.sh b/wireguard-install.sh index 68c4783..a35efe6 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -97,7 +97,7 @@ elif [[ "$OS" = 'fedora' ]]; then if [[ "$VERSION_ID" -lt 32 ]]; then dnf install -y dnf-plugins-core dnf copr enable -y jdoss/wireguard - dnf install -y wireguard-dkms + dnf install -y wireguard-dkms fi dnf install -y wireguard-tools iptables qrencode elif [[ "$OS" = 'centos' ]]; then @@ -127,8 +127,8 @@ ListenPort = $SERVER_PORT PrivateKey = $SERVER_PRIV_KEY" > "/etc/wireguard/$SERVER_WG_NIC.conf" if [ -x "$(command -v firewall-cmd)" ]; then - FIREWALLD_IPV4_ADDRESS=$(echo $SERVER_WG_IPV4 | cut -d"." -f1-3)".0" - FIREWALLD_IPV6_ADDRESS=$(echo $SERVER_WG_IPV6 | sed 's/:[^:]*$/:0/') + FIREWALLD_IPV4_ADDRESS=$(echo "$SERVER_WG_IPV4" | cut -d"." -f1-3)".0" + FIREWALLD_IPV6_ADDRESS=$(echo "$SERVER_WG_IPV6" | sed 's/:[^:]*$/:0/') echo "PostUp = firewall-cmd --add-port $SERVER_PORT/udp && firewall-cmd --add-rich-rule='rule family=ipv4 source address=$FIREWALLD_IPV4_ADDRESS/24 masquerade' && firewall-cmd --add-rich-rule='rule family=ipv6 source address=$FIREWALLD_IPV6_ADDRESS/24 masquerade' PostDown = firewall-cmd --remove-port $SERVER_PORT/udp && firewall-cmd --remove-rich-rule='rule family=ipv4 source address=$FIREWALLD_IPV4_ADDRESS/24 masquerade' && firewall-cmd --remove-rich-rule='rule family=ipv6 source address=$FIREWALLD_IPV6_ADDRESS/24 masquerade'" >> "/etc/wireguard/$SERVER_WG_NIC.conf" else