Update auto_post_install.sh

This commit is contained in:
MacRimi 2025-08-17 15:04:27 +02:00 committed by GitHub
parent 5447f0e4df
commit 8e1f955519
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,7 +172,6 @@ configure_time_sync() {
msg_warn "$(translate "Failed to obtain public IP address")" msg_warn "$(translate "Failed to obtain public IP address")"
timezone="UTC" timezone="UTC"
else else
timezone=$(curl -s "https://ipapi.co/${this_ip}/timezone") timezone=$(curl -s "https://ipapi.co/${this_ip}/timezone")
if [ -z "$timezone" ]; then if [ -z "$timezone" ]; then
msg_warn "$(translate "Failed to determine timezone from IP address")" msg_warn "$(translate "Failed to determine timezone from IP address")"
@ -184,13 +183,15 @@ configure_time_sync() {
timedatectl set-timezone "$timezone" timedatectl set-timezone "$timezone"
msg_info "$(translate "Enabling automatic time synchronization...")"
if timedatectl set-ntp true; then if timedatectl set-ntp true; then
msg_ok "$(translate "Time settings configured - Timezone:") $timezone" msg_ok "$(translate "Time settings configured - Timezone:") $timezone"
register_tool "time_sync" true register_tool "time_sync" true
systemctl restart postfix 2>/dev/null || true
else else
msg_error "$(translate "Failed to enable automatic time synchronization")" msg_error "$(translate "Failed to enable automatic time synchronization")"
fi fi
} }
# ========================================================== # ==========================================================