Skip to content
Snippets Groups Projects
Commit adfaa191 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

hostmngr: uci-defaults: convert old hosts config to new format

parent cf8b2966
Branches
No related tags found
1 merge request!739hostmngr: uci-defaults: convert old hosts config to new format
#!/bin/sh
uci -q get hosts.global.ageing_timer || exit 1
# Old hosts UCI config is detected; Convert to new format
ageing_timer="$(uci -q get hosts.global.ageing_timer)"
history_timeout=$((ageing_timer*60))
uci -q set hosts.global.enabled=1
uci -q delete hosts.global.ageing_timer
uci -q set hosts.global.history_timeout="$history_timeout"
uci -q rename hosts.global.reboot_persistent=history
uci -q set hosts.global.history_file="/etc/hosts_history.json"
uci -q add hosts interface
for ifname in $(uci -q get hosts.global.ifname); do
uci -q add_list hosts.@interface[-1].ifname="$ifname"
done
uci -q delete hosts.global.ifname
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment