Skip to content

Instantly share code, notes, and snippets.

@jumpsmm7
jumpsmm7 / fetch-ntp
Created June 21, 2019 18:04 — forked from cynicastic/fetch-ntp
Fetch time from ntp server (call from Asuswrt-Merlin init-start script)
#!/bin/sh
#
# Script: fetch-ntp
#
# script to get time from time server as quickly as possible
# call from init-start as "/jffs/scripts/fetch-ntp ww.xx.yy.zz cc &"
# where ww.xx.yy.zz is IP address (duh!) and cc is number of seconds
# to loop; if cc is not specified, defaults to 60 seconds
# Do not use URL! use IP only so we don't wait for DNS to come up
# `&` at end is critical - spawns this as an asynchronous task and continues