Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--- 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
You can’t perform that action at this time.