Created
February 3, 2013 12:14
-
-
Save thejhh/4701550 to your computer and use it in GitHub Desktop.
Script that creates google calendar events for turn changes in LT31 online Freeciv game.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| game="LT31" | |
| start_turn=66 | |
| start_time=1359900000 | |
| end_turn=200 | |
| hours=23 | |
| for((i=$start_turn; i<=$end_turn; i++)); do | |
| turn="$i" | |
| timestamp="$(calc -p "$start_time + ($i-$start_turn) *$hours*3600")" | |
| date_start="$(date -d '@'"$timestamp" '+%Y-%m-%dT%H:%M:%S')" | |
| date_end="$(date -d '@'"$(calc -p "$timestamp + 1800")" '+%Y-%m-%dT%H:%M:%S')" | |
| date="$date_start,$date_end" | |
| google calendar add --reminder='60m' -d "$date" "$game/T$turn" | |
| sleep 1 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment