Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
- now=`date +%s`
- filetime=`stat -f %m $me`
- if [ "$now" -lt "$filetime" ]; then
- echo "System time is too old. Updating system time."
- date -f %s $filetime
- else
- # Touch the file to update the mtime.
- touch $me
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement