Skip to content

Instantly share code, notes, and snippets.

@mkrkn
mkrkn / zz_firewall_add_network.sh
Last active May 25, 2020 01:45
A sample snippet for editing OpenWrt firewall zone configuration via the UCI command interface. As zone sections are anonymous sections some extra code is needed to discover them. To the extent that the work is copyrightable, it is licensed under the MIT/X11 License.
#!/bin/sh
# Copyright (c) 2020 Magnus Kroken
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in