timemngr: uci option for day light saving time

This commit is contained in:
Suvendhu Hansa 2024-09-05 13:17:53 +05:30 committed by Vivek Kumar Dutta
parent ee779c0fd8
commit b74c2d2d17
3 changed files with 21 additions and 3 deletions

View file

@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=timemngr
PKG_VERSION:=1.1.0
PKG_VERSION:=1.1.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)

View file

@ -1,5 +1,6 @@
config global 'global'
option enable '1'
option dst '1'
config client 'client'
option enable '1'

View file

@ -19,6 +19,21 @@ validate_global_section() {
'mdns:bool:1'
}
boot() {
config_load time
config_get_bool dst_enable global dst 1
if [ "${dst_enable}" -eq 1 ]; then
if ! grep -qF "#timemngr-dst" /etc/crontabs/root; then
echo "* * * * * service system restart #timemngr-dst" >> /etc/crontabs/root
fi
else
sed -i '/#timemngr-dst/d' /etc/crontabs/root
fi
start
}
start_service() {
local enable loglevel server_enable mdns
@ -45,8 +60,10 @@ start_service() {
fi
# Generate Config & Start timemngr instance
generate_config
create_service
if [ "${enable}" -eq 1 ]; then
generate_config
create_service
fi
}
reload_service() {