Fix incorrect service name on Debian in `add-rule`
On Debian, the iptables-persistent service has been renamed to netfilter-persistent. The svc-map includes both default, ubuntu, and debian as ubuntu will "fallback" to debian as they are considered the same family of distro. Change-Id: I180a580820015a60ceb2221873a38ebbb06cf953
This commit is contained in:
parent
d99cf49c9d
commit
64d88fa508
|
@ -37,10 +37,15 @@ if [[ "RedHatEnterpriseServer CentOS Fedora" =~ "$DISTRO" ]]; then
|
|||
fi
|
||||
|
||||
elif [[ "Debian Ubuntu" =~ "$DISTRO" ]]; then
|
||||
service iptables-persistent reload
|
||||
# NOTE(kiall): os-svc-restart etc don't support the custom 'save'
|
||||
# action, so we grab the name and call the service
|
||||
# binary "by hand" instead.
|
||||
SERVICE_NAME=$(svc-map iptables-persistent)
|
||||
|
||||
service $SERVICE_NAME reload
|
||||
|
||||
iptables -C $RULE || iptables -I $RULE
|
||||
|
||||
service iptables-persistent save
|
||||
service $SERVICE_NAME save
|
||||
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
iptables-persistent:
|
||||
default: iptables-persistent
|
||||
ubuntu: iptables-persistent
|
||||
debian: netfilter-persistent
|
Loading…
Reference in New Issue