aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSukru Senli <sukru.senli@iopsys.eu>2020-05-22 16:33:04 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2020-06-27 00:19:13 +0200
commitc856f7adfb355b218728a5a7cc60d6fafd9b3b94 (patch)
tree42b98c1301f4b4a4d39ac790e9b5f002cb81bd8b
parent930f3c014821df423507c878415c7fb4910a454d (diff)
downloadupstream-c856f7adfb355b218728a5a7cc60d6fafd9b3b94.tar.gz
upstream-c856f7adfb355b218728a5a7cc60d6fafd9b3b94.tar.bz2
upstream-c856f7adfb355b218728a5a7cc60d6fafd9b3b94.zip
netifd: replace timesvr with timesrv
/lib/netifd/dhcp.script: Keep support for 'timesvr' while also supporting 'timesrv' Add log message indicating deprecation of 'timesvr' Signed-off-by: Sukru Senli <sukru.senli@iopsys.eu>
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/dhcp.script8
1 files changed, 7 insertions, 1 deletions
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index 00604f40e7..6585b641d6 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -46,10 +46,16 @@ setup_interface () {
proto_add_dns_search "$i"
done
+ # TODO: Deprecate timesvr in favor of timesrv
+ if [ -n "$timesvr" -a -z "$timesrv" ]; then
+ timesrv="$timesvr"
+ echo "Environment variable 'timesvr' will be deprecated; use 'timesrv' instead."
+ fi
+
proto_add_data
[ -n "$ZONE" ] && json_add_string zone "$ZONE"
[ -n "$ntpsrv" ] && json_add_string ntpserver "$ntpsrv"
- [ -n "$timesvr" ] && json_add_string timeserver "$timesvr"
+ [ -n "$timesrv" ] && json_add_string timeserver "$timesrv"
[ -n "$hostname" ] && json_add_string hostname "$hostname"
[ -n "$message" ] && json_add_string message "$message"
[ -n "$timezone" ] && json_add_int timezone "$timezone"