network: use iptables-restore --wait if available
Avoid bailing out early if multiple instances of iptables-restore are called simultaneously. Fixes QubesOS/qubes-issues#3665
This commit is contained in:
parent
5f81f0486d
commit
8f6bd245bd
@ -42,9 +42,14 @@ start() {
|
|||||||
# Do not start if there is no config file.
|
# Do not start if there is no config file.
|
||||||
[ ! -f "$IPTABLES_DATA" ] && return 6
|
[ ! -f "$IPTABLES_DATA" ] && return 6
|
||||||
|
|
||||||
|
CMD_ARGS=
|
||||||
|
if "$CMD-restore" --help 2>&1 | grep -q wait=; then
|
||||||
|
CMD_ARGS=--wait
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n $"${CMD}: Applying firewall rules: "
|
echo -n $"${CMD}: Applying firewall rules: "
|
||||||
|
|
||||||
"$CMD-restore" "$IPTABLES_DATA"
|
"$CMD-restore" $CMD_ARGS "$IPTABLES_DATA"
|
||||||
ret="$?"
|
ret="$?"
|
||||||
if [ "$ret" -eq 0 ]; then
|
if [ "$ret" -eq 0 ]; then
|
||||||
echo OK
|
echo OK
|
||||||
|
Loading…
Reference in New Issue
Block a user