Skip to content

Instantly share code, notes, and snippets.

@superdaigo
Created December 16, 2017 05:22
Show Gist options
  • Save superdaigo/da73772841c1e1f207985e61c596af22 to your computer and use it in GitHub Desktop.
Save superdaigo/da73772841c1e1f207985e61c596af22 to your computer and use it in GitHub Desktop.
#!/bin/bash
STOP_AT=$(date -j -v "+1H" "+%H:%M")
if [ ! -z $1 ] && [[ $1 =~ ^[0-9]{1,2}:[0-9]{2}$ ]] ; then
STOP_AT="${1}"
if [ ${#1} -eq 4 ] ; then
STOP_AT="0${1}"
fi
fi
echo "Will stop at ${STOP_AT}"
while :
do
MS=$(date "+%M%S")
TIME=$(date "+%H:%M")
if [ ${MS:1:3} -eq "000" ] ; then
say -v Kyoko "${TIME} になりました"
fi
if [ ${TIME} = ${STOP_AT} ] ; then
exit
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment