Skip to content

Instantly share code, notes, and snippets.

@fape
Last active October 13, 2018 11:16
Show Gist options
  • Save fape/d06af6c9ccf9293606cb1a5779e8c715 to your computer and use it in GitHub Desktop.
Save fape/d06af6c9ccf9293606cb1a5779e8c715 to your computer and use it in GitHub Desktop.
rdate m1q
#!/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