Fix issue detecting the rules file.

This commit is contained in:
Eduard Tolosa 2023-04-16 00:35:20 +00:00 committed by GitHub
parent 3a81a3b48a
commit 144767ebb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,14 +59,14 @@ case "$1" in
fi fi
;; ;;
stop) stop)
if ! -f "$RULES"; then if test -f "$RULES"; then
echo "$RULES does not exist. Not doing anything."
exit
else
echo "Restoring previous rules from $RULES" echo "Restoring previous rules from $RULES"
iptables -t nat -F iptables -t nat -F
iptables-restore < $RULES iptables-restore < "$RULES"
rm $RULES rm "$RULES"
else
echo "$RULES does not exist. Not doing anything."
exit
fi fi
;; ;;
restart) restart)