mirror of
https://github.com/angristan/wireguard-install.git
synced 2025-04-05 03:43:30 +03:00
fix: check if firewall-cmd exists
This commit is contained in:
parent
bef76ae03e
commit
e427205da2
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ Address = $SERVER_WG_IPV4/24,$SERVER_WG_IPV6/64
|
|||
ListenPort = $SERVER_PORT
|
||||
PrivateKey = $SERVER_PRIV_KEY" > "/etc/wireguard/$SERVER_WG_NIC.conf"
|
||||
|
||||
if [[ "$OS" = 'fedora' ]]; then
|
||||
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/')
|
||||
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'
|
||||
|
|
Loading…
Add table
Reference in a new issue