stormux/pi4/files/usr/local/bin/sync_time.sh

5 lines
130 B
Bash
Raw Normal View History

#!/usr/bin/env bash
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
date -s "$date_time"