Compare commits

...

2 Commits

Author SHA1 Message Date
57cf93ac41 rework conf_ntp module 2025-09-25 20:44:35 +02:00
e32501537d fusion commit 2025-09-25 20:42:59 +02:00
2 changed files with 17 additions and 10 deletions

View File

@@ -11,7 +11,7 @@
# * NTPSERVERS: list of NTP servers
# ------------------------------------------------------------------------------
export VER_conf_ntp="0.1.6"
export VER_conf_ntp="0.2.0"
export DEP_conf_ntp=""
conf_ntp()
@@ -21,16 +21,13 @@ conf_ntp()
systemctl disable systemd-timesyncd || true
fi
NTP_SERV=${NTP_SERV:-ntp}
prnt I "Installing ntp daemon..."
pkginst ntp
pkginst $NTP_SERV
prnt I "Stopping service ntp..."
if [[ -n $NTP_SERV ]]; then
svc_stop $NTP_SERV
else
svc_stop ntp
fi
svc_stop $NTP_SERV
if [[ -n $NTP_SERV ]]; then
if [[ $NTP_SERV == ntpsec ]]; then
local conf_file="/etc/$NTP_SERV/ntp.conf"
else
local conf_file="/etc/ntp.conf"

View File

@@ -18,12 +18,14 @@
# TODO: This is Debian only, make this universal (at least yum/dnf compatible)
# ------------------------------------------------------------------------------
export VER_upgrade_dist="0.2.5"
export VER_upgrade_dist="0.3.0"
# As aptitude might fail if clock is too far from real time, we need to depend
# on ntp
export DEP_upgrade_dist="conf_ntp"
export SOURCE_EXT="${SOURCE_EXT:-list}"
upgrade_dist()
{
local proxyfile=/etc/apt/apt.conf.d/00proxy
@@ -67,7 +69,12 @@ upgrade_dist()
fi
# Remplace source.list from dist with ours (be smarter)
install_file "pkgman/${SYS_DIST}_${SYS_VER}.list" /etc/apt/sources.list
if [[ NO_MAIN_SOURCE==true ]]; then
install_file "pkgman/${SYS_DIST}_${SYS_VER}.list" "/etc/apt/sources.list.d/debian.${SOURCE_EXT}"
else
# We don't use SYS_EXT
install_file "pkgman/${SYS_DIST}_${SYS_VER}.list" "/etc/apt/sources.list"
fi
prnt I "Updating package list..."
pkgupdt
@@ -96,6 +103,9 @@ precheck_upgrade_dist()
die 160
fi
file_must_exists pkgman/${SYS_DIST}_${SYS_VER}.list
if [[ -z $NO_MAIN_SOURCE ]]; then
prnt E "A required variable to configure apt is not defined."
fi
}
cron_upgrade_dist()