summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-nut/root
diff options
context:
space:
mode:
authorDaniel Dickinson <lede@cshore.thecshore.com>2016-08-13 20:35:01 -0400
committerDaniel F. Dickinson <cshored@thecshore.com>2018-08-29 01:03:17 -0400
commitfb262ad268ce7de9de79d47145c434e2662f2941 (patch)
tree9ffd72199ba22ea7b67bd62484cc459418c45398 /applications/luci-app-nut/root
parentb93d3f3a1812e05def960835d39080780edb7129 (diff)
luci-app-nut: Add support for NUT configuration
Adds app to configure NUT (Network UPS Tools), including nut-server, nut-monitor, and nut-cgi. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Diffstat (limited to 'applications/luci-app-nut/root')
-rwxr-xr-xapplications/luci-app-nut/root/etc/uci-defaults/40_luci-nut22
1 files changed, 22 insertions, 0 deletions
diff --git a/applications/luci-app-nut/root/etc/uci-defaults/40_luci-nut b/applications/luci-app-nut/root/etc/uci-defaults/40_luci-nut
new file mode 100755
index 000000000..621f6a6a3
--- /dev/null
+++ b/applications/luci-app-nut/root/etc/uci-defaults/40_luci-nut
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+version="$(opkg status nut|grep 'Version: '|cut -f2 -d\ )"
+release="$(echo $version|cut -f2 -d-)"
+
+if [ "$version" = "2.7.4" ] && [ "$release" -lt 8 ]; then
+ uci -q batch <<-EOF >/dev/null
+ delete ucitrack.@nut_server[-1]
+ delete ucitrack.@nut_monitor[-1]
+ delete ucitrack.@nut_cgi[-1]
+ add ucitrack nut_server
+ set ucitrack.@nut_server[-1].init=nut-server
+ add ucitrack nut_monitor
+ set ucitrack.@nut_monitor[-1].init=nut-monitor
+ add ucitrack nut_cgi
+ set ucitrack.@nut_cgi[-1].init=nut-cgi
+ commit ucitrack
+EOF
+fi
+
+rm -f /tmp/luci-indexcache
+exit 0