Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: xpector on March 07, 2018, 12:02:22 PM

Title: How to configure a listening-only NTP client?
Post by: xpector on March 07, 2018, 12:02:22 PM
I'm creating an advertisement display. It will be behind a firewall, and even within its own network segment it should never make an outgoing connection, but only receive stuff, like a picture to display (via VNC listening client) or current datetime. It is not known in advance, what host(s) will send stuff; luckily, everything from own segment is okay to accept.

So polling pool.ntp.org is obviously not an option. According to man, "ntpd can operate in any of several modes, including symmetric active/passive".

Disclaimer: this is a cross-post from superuser.com
Title: Re: How to configure a listening-only NTP client?
Post by: xpector on March 20, 2018, 05:55:35 PM
A bit dirty and not that quick at all. Anyway:
A peer PC calls wget and includes the timestamp into the URI, like this: http://myraspi:8888/201803201234.56
On RasPi, netcat listens port 8888, greps requests for timestamps and pipes those to xargs date --set

Inspired by https://jonlabelle.com/snippets/view/shell/netcat-commands (https://jonlabelle.com/snippets/view/shell/netcat-commands)