Skip to content

Commit

Permalink
v6.31
Browse files Browse the repository at this point in the history
+ DietPi-Set_software | NTP mirror: Fix gateway detection
  • Loading branch information
MichaIng authored Jun 24, 2020
1 parent 4e10fbb commit 66f937a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dietpi/func/dietpi-set_software
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ _EOF_
if [[ ${ntp_mirror,,} == 'gateway' ]]; then

# NB: Convert output to single line via ORS, remove trailing space afterwards
local gateway=$(ip r s 0.0.0.0/0 | mawk '{print $3}' ORS=' ') gateway=${gateway% }
local gateway=$(ip r l 0/0 | mawk '{print $3}' ORS=' '); gateway=${gateway% }
if [[ $gateway ]]; then

G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)."
Expand Down

1 comment on commit 66f937a

@Joulinar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified, it's working now

root@DietPi:/etc/apt# dietpi-config
[  OK  ] DietPi-Config | Desired setting in /boot/dietpi.txt was already set: CONFIG_NTP_MIRROR=Gateway
[ SUB2 ] DietPi-Set_software > ntpd-mode (2)
[  OK  ] DietPi-Set_software | Gateway(s) detected: 192.168.0.1, adding as NTP server(s).
[  OK  ] DietPi-Set_software | Setting in /boot/dietpi.txt adjusted: CONFIG_NTP_MODE=2
[  OK  ] ntpd-mode 2 | Completed
[ INFO ] DietPi-Run_NTPD | systemctl restart systemd-timesyncd, please wait...
[  OK  ] DietPi-Run_NTPD | systemctl restart systemd-timesyncd
[  OK  ] DietPi-Run_NTPD | systemd-timesyncd synced
[  OK  ] Network time sync | Completed

Please sign in to comment.