iopsys-feed/timemngr/files/etc/hotplug.d/ntp/40-firstUseDate
2023-09-22 08:48:51 +05:30

10 lines
318 B
Bash

#!/bin/sh
# This hotplug script set the firstUseDate if not already set
[ "$ACTION" = stratum ] || exit 0
[ -f "/etc/config/time" ] || exit 0
if ! uci -q get time.global.first_use_date > /dev/null 2>&1; then
uci -q set time.global.first_use_date="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
uci commit time
fi