mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
timemngr: uci option for day light saving time
This commit is contained in:
parent
ee779c0fd8
commit
b74c2d2d17
3 changed files with 21 additions and 3 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=timemngr
|
PKG_NAME:=timemngr
|
||||||
PKG_VERSION:=1.1.0
|
PKG_VERSION:=1.1.1
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
config global 'global'
|
config global 'global'
|
||||||
option enable '1'
|
option enable '1'
|
||||||
|
option dst '1'
|
||||||
|
|
||||||
config client 'client'
|
config client 'client'
|
||||||
option enable '1'
|
option enable '1'
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,21 @@ validate_global_section() {
|
||||||
'mdns:bool:1'
|
'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() {
|
start_service() {
|
||||||
local enable loglevel server_enable mdns
|
local enable loglevel server_enable mdns
|
||||||
|
|
||||||
|
|
@ -45,8 +60,10 @@ start_service() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate Config & Start timemngr instance
|
# Generate Config & Start timemngr instance
|
||||||
generate_config
|
if [ "${enable}" -eq 1 ]; then
|
||||||
create_service
|
generate_config
|
||||||
|
create_service
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
reload_service() {
|
reload_service() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue