summaryrefslogtreecommitdiff
path: root/sentinel-minipot/files/uci-defaults
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-07-11 16:06:13 +0200
committerKarel Kočí <cynerd@email.cz>2020-07-11 16:06:13 +0200
commit2f31048b9123444aed7559b72c56645d73379e4b (patch)
treeb7ec0953b884ea2be3815adc8e488327d8871dd0 /sentinel-minipot/files/uci-defaults
parentc1fac266afb99c28ffbb8213d8cf1f6c19a5b13b (diff)
downloadopenwrt-personal-pkgs-2f31048b9123444aed7559b72c56645d73379e4b.tar.gz
openwrt-personal-pkgs-2f31048b9123444aed7559b72c56645d73379e4b.tar.bz2
openwrt-personal-pkgs-2f31048b9123444aed7559b72c56645d73379e4b.zip
sentinel-minipot: include latest turris-os-version
Diffstat (limited to 'sentinel-minipot/files/uci-defaults')
-rw-r--r--sentinel-minipot/files/uci-defaults25
1 files changed, 25 insertions, 0 deletions
diff --git a/sentinel-minipot/files/uci-defaults b/sentinel-minipot/files/uci-defaults
new file mode 100644
index 0000000..f90516c
--- /dev/null
+++ b/sentinel-minipot/files/uci-defaults
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+. /lib/functions/sentinel-firewall.sh
+
+# Minipot entry in sentinel config
+if [ "$(uci -q get sentinel.minipot)" != "minipot" ]; then
+ uci -q batch <<EOT
+ delete sentinel.minipot
+ set sentinel.minipot='minipot'
+ commit sentinel.minipot
+EOT
+fi
+
+# Remove old firewall rules
+[ -z "$(uci -q get firewall.sentinel_minipot_telnet_mark)" ] || \
+ uci -q delete firewall.sentinel_minipot_telnet_mark
+[ -z "$(uci -q get firewall.sentinel_minipot_telnet)" ] || \
+ uci -q delete firewall.sentinel_minipot_telnet
+
+
+# Enable for wan interface in default
+config_firewall_default_enable "sentinel_minipot"
+
+# Always reload firewall to use latest version of sentinel-firewall script
+/etc/init.d/firewall reload