firmware/src/packages/fff/fff-sysupgrade/files/etc/uci-defaults/05-config-system-migration

22 lines
1.0 KiB
Bash

#!/bin/sh
UPGRADE_hostname=$(uci -q get "system.@system[0].hostname")
UPGRADE_description=$(uci -q get "system.@system[0].description")
UPGRADE_latitude=$(uci -q get "system.@system[0].latitude")
UPGRADE_longitude=$(uci -q get "system.@system[0].longitude")
UPGRADE_position_comment=$(uci -q get "system.@system[0].position_comment")
UPGRADE_contact=$(uci -q get "system.@system[0].contact")
/bin/rm -rf /etc/config/system
/bin/config_generate
test -n "${UPGRADE_hostname}" && uci -q set "system.@system[0].hostname=${UPGRADE_hostname}"
test -n "${UPGRADE_description}" && uci -q set "system.@system[0].description=${UPGRADE_description}"
test -n "${UPGRADE_latitude}" && uci -q set "system.@system[0].latitude=${UPGRADE_latitude}"
test -n "${UPGRADE_longitude}" && uci -q set "system.@system[0].longitude=${UPGRADE_longitude}"
test -n "${UPGRADE_position_comment}" && uci -q set "system.@system[0].position_comment=${UPGRADE_position_comment}"
test -n "${UPGRADE_contact}" && uci -q set "system.@system[0].contact=${UPGRADE_contact}"
uci -q commit system