Skip to content

Instantly share code, notes, and snippets.

@perennialmind
Last active August 2, 2017 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perennialmind/6244824e616d66b3d69679b660a41329 to your computer and use it in GitHub Desktop.
Save perennialmind/6244824e616d66b3d69679b660a41329 to your computer and use it in GitHub Desktop.
--- a/etc/init.d/ubnt-rcS
+++ b/etc/init.d/ubnt-rcS
@@ -29,8 +29,11 @@
if [ ! -e "$LAST_TIME_FILE" ]; then
echo '2015-01-01 00:00' >$LAST_TIME_FILE
+ touch -d '2015-01-01 00:00' $LAST_TIME_FILE
fi
- /bin/date -s "$(cat $LAST_TIME_FILE)" >/dev/null 2>&1
+ local last_time="$(date -r $LAST_TIME_FILE +%s)"
+ local sys_time="$(date +%s)"
+ [ $sys_time -lt $last_time ] && /bin/date -s @$last_time >/dev/null 2>&1
mkdir /run/lock /run/sendsigs.omit.d /dev/shm/network
touch /var/log/wtmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment