Header Shadow Image


Asus Merlin Firmware: Wrong date shows set to Sat May  5 01:07:40 DST 2018

Do you end up with the wrong date when using Asus or Asus Merlin software?

admin@ASUS-MERLIN-INTERNET:/tmp/home/root# date
Sat May  5 01:07:40 DST 2018
admin@ASUS-MERLIN-INTERNET:/tmp/home/root#

Not yet clear what is really causing this but a temporary workaround is shown below using the Asus Merlin startup scripts:

admin@ASUS-MERLIN-INTERNET:/tmp/home/root# cat /jffs/scripts/init-start
#!/bin/sh

NTP0=$(nvram show 2>/dev/null | awk -F'=' '/ntp_server0/{ print $2 }')
NTP1=$(nvram show 2>/dev/null | awk -F'=' '/ntp_server1/{ print $2 }')
PSV=$(ps|grep -Ei "ntpd_[s]ynced"|wc -l)

echo "Using the following NTP servers: NTP0 ($NTP0) and NTP1 ($NTP1).  Number of running NTP servers right now is $PSV";

if [[ $NTP0 != “” && $NTP1 != “” && $PSV == 0 ]]; then
        /usr/sbin/ntp -d -n -t -S /sbin/ntpd_synced -p $NTP0 -p $NTP1 &
        if $? == 0; then
                echo "SUCCESS: Started the NTPD server."
        else
                echo "FAILED to start the NTPD server.  Non 0 exit code detected."
        fi
else
        echo "ERROR:  Either NTP0($NTP0) or NTP1($NTP1) was empty.  Or NTPD was already started.  No action taken.";
fi
admin@ASUS-MERLIN-INTERNET:/tmp/home/root# ls -altri /jffs/scripts/init-start
   9640 -rwxr-x—    1 admin    root           716 Oct 17 18:50 /jffs/scripts/init-start
admin@ASUS-MERLIN-INTERNET:/tmp/home/root#

It uses the nvram variables to retireve your configured NTP servers.  

Hope this helps!

Thx,

Leave a Reply

You must be logged in to post a comment.


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License