Last active
October 13, 2018 11:16
-
-
Save fape/d06af6c9ccf9293606cb1a5779e8c715 to your computer and use it in GitHub Desktop.
rdate m1q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#export TZ='CET-1CEST,M3.5.0,M10.5.0/3' | |
#export TZ='CentralEuropeStandardTime-1DaylightTime,M3.5.0,M10.5.0/3' | |
/bin/echo "start setdate" | |
/bin/sleep 45 | |
/usr/sbin/rdate -s 192.168.2.1 | |
/bin/echo "rdate set" | |
#date -D '%s' +"%Y-%m-%d %H:%M:%S" -d "$(( `date +%s`+2*60*60 ))" | |
D=2 | |
T1=$((`/bin/date +%s`+$D*60*60)) | |
T2=`/bin/date -D '%s' +"%Y-%m-%d %H:%M:%S" -d "$T1"` | |
#echo "set $T2" | |
/bin/date -s "$T2" | |
/bin/echo "end setdate" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment