blob: f2c094dd76c79c15e0ec51d7d05bc91b00ba9733 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/sh
# unfortunately, UCI doesn't provide a nice way to add an anonymous section only if it doesn't already exist
if ! uci show firewall | grep -q firewall.fail2ban; then
name="$(uci add firewall include)"
uci set "firewall.${name}.path=/etc/firewall.fail2ban"
uci set "firewall.${name}.enabled=1"
uci set "firewall.${name}.reload=1"
echo -e "Adding the following UCI config:\n $(uci changes)"
uci commit
fi
exit 0
|