Skip to content

Instantly share code, notes, and snippets.

@rgerganov
Created March 3, 2018 20:39
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 rgerganov/2f0b0c43f90791aa6211b05e679dd0be to your computer and use it in GitHub Desktop.
Save rgerganov/2f0b0c43f90791aa6211b05e679dd0be to your computer and use it in GitHub Desktop.
Wake up script for OSX
#!/bin/bash
wake_time="2018-03-04.02:30:00"
wake_time_epoch=$(date -j -f %Y-%m-%d.%H:%M:%S $wake_time +%s)
while [ 1 ]; do
now_epoch=$(date +%s)
if [ $now_epoch -ge $wake_time_epoch ]; then
break
fi
sleep 1
done
while [ 1 ]; do
say 'wake up'
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment