Last active
January 20, 2019 12:27
-
-
Save anothergituser/d2844c39bfae9039cfe9060170c8814b to your computer and use it in GitHub Desktop.
iptables systemctl /etc/rc.d/init.d/iptables_user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# chkconfig: - 50 50 | |
# description: Initializes custom firewall | |
usage () | |
{ | |
echo $"Usage: $0 {start|stop|status|restart|condrestart}" 1>&2 | |
} | |
start () | |
{ | |
/usr/sbin/iptables-restore < /etc/iptables/iptables.rules | |
} | |
stop () | |
{ | |
/usr/sbin/iptables -F | |
/usr/sbin/iptables -X | |
} | |
status () | |
{ | |
/usr/sbin/iptables -nvL | |
} | |
restart () | |
{ | |
stop | |
start | |
} | |
case "$1" in | |
stop) stop ;; | |
status) status ;; | |
start|restart|reload|force-reload) restart ;; | |
*) usage ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment