1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-06-05 21:10:48 +00:00

Use firewall-cmd only if firewalld is running

Fix #95
This commit is contained in:
randomshell 2020-07-04 22:23:16 +00:00
parent e7d4bee59f
commit fc8039a3cf

View File

@ -170,7 +170,7 @@ Address = ${SERVER_WG_IPV4}/24,${SERVER_WG_IPV6}/64
ListenPort = ${SERVER_PORT}
PrivateKey = ${SERVER_PRIV_KEY}" >"/etc/wireguard/${SERVER_WG_NIC}.conf"
if [ -x "$(command -v firewall-cmd)" ]; then
if pgrep firewalld; then
FIREWALLD_IPV4_ADDRESS=$(echo "${SERVER_WG_IPV4}" | cut -d"." -f1-3)".0"
# shellcheck disable=SC2001
FIREWALLD_IPV6_ADDRESS=$(echo "${SERVER_WG_IPV6}" | sed 's/:[^:]*$/:0/')