mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
timemngr: run cron job to apply dst
This commit is contained in:
parent
627a4c4ad6
commit
6a34e2da97
3 changed files with 21 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
config global 'global'
|
||||
option enable '1'
|
||||
option dst '1'
|
||||
|
||||
config client 'client'
|
||||
option enable '1'
|
||||
|
|
|
|||
|
|
@ -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 "0 0 * * * 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() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue