]> git.ipfire.org Git - people/ms/network.git/commitdiff
firewall: Add init action to main script
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 22 Jun 2019 13:50:00 +0000 (13:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 22 Jun 2019 13:50:00 +0000 (13:50 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/firewall

index db7284cd87d757af23ac3836303985193a8d9f99..c47ac6116a6d83678a21fc169c3628e554e29686 100644 (file)
 #                                                                             #
 ###############################################################################
 
+# Parse the command line
+while [ $# -gt 0 ]; do
+       case "${1}" in
+               -d|--debug)
+                       DEBUG=1
+                       ;;
+               *)
+                       action=${1}
+                       ;;
+       esac
+       shift
+       [ -n "${action}" ] && break
+done
+
 . /usr/lib/network/functions
 
 # Read firewall settings
 firewall_settings_read
 
-firewall_cli "ipv6" "$@"
+case "${action}" in
+       # Initialise kernel with firewall settings
+       init)
+               firewall_kernel_init
+               exit $?
+               ;;
+
+       *)
+               firewall_cli "ipv6" "${action}" "$@"
+               ;;
+esac
 
 exit ${EXIT_ERROR}