1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-11-28 15:56:36 +00:00

Fix shellcheck

This commit is contained in:
Stanislas Lange 2020-03-21 21:53:06 +01:00
parent a810f727dd
commit 8130dc7b70
2 changed files with 4 additions and 4 deletions

View File

@ -8,6 +8,6 @@ jobs:
- name: shellcheck - name: shellcheck
uses: ludeeus/action-shellcheck@0.0.1 uses: ludeeus/action-shellcheck@0.0.1
env: env:
SHELLCHECK_OPTS: -e SC1091,SC1117 SHELLCHECK_OPTS: -e SC1091,SC1117,SC2001
with: with:
args: wireguard-install.sh args: wireguard-install.sh

View File

@ -97,7 +97,7 @@ elif [[ "$OS" = 'fedora' ]]; then
if [[ "$VERSION_ID" -lt 32 ]]; then if [[ "$VERSION_ID" -lt 32 ]]; then
dnf install -y dnf-plugins-core dnf install -y dnf-plugins-core
dnf copr enable -y jdoss/wireguard dnf copr enable -y jdoss/wireguard
dnf install -y wireguard-dkms dnf install -y wireguard-dkms
fi fi
dnf install -y wireguard-tools iptables qrencode dnf install -y wireguard-tools iptables qrencode
elif [[ "$OS" = 'centos' ]]; then elif [[ "$OS" = 'centos' ]]; then
@ -127,8 +127,8 @@ ListenPort = $SERVER_PORT
PrivateKey = $SERVER_PRIV_KEY" > "/etc/wireguard/$SERVER_WG_NIC.conf" PrivateKey = $SERVER_PRIV_KEY" > "/etc/wireguard/$SERVER_WG_NIC.conf"
if [ -x "$(command -v firewall-cmd)" ]; then if [ -x "$(command -v firewall-cmd)" ]; then
FIREWALLD_IPV4_ADDRESS=$(echo $SERVER_WG_IPV4 | cut -d"." -f1-3)".0" FIREWALLD_IPV4_ADDRESS=$(echo "$SERVER_WG_IPV4" | cut -d"." -f1-3)".0"
FIREWALLD_IPV6_ADDRESS=$(echo $SERVER_WG_IPV6 | sed 's/:[^:]*$/: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' 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" 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 else