Skip to content

Instantly share code, notes, and snippets.

@grimsy
Created April 21, 2017 01:15
Show Gist options
  • Save grimsy/5bf94e8b8e1e35e1c327b6d5cdfed19a to your computer and use it in GitHub Desktop.
Save grimsy/5bf94e8b8e1e35e1c327b6d5cdfed19a to your computer and use it in GitHub Desktop.
auto imports ics files from realestate.com.au into a dedicated google calendar (using gcalcli). set up a cron to find *.ics in Downloads folder and call this script with the full path to the file as an argument.
#!/bin/bash
ADDRESS=`cat $1 | grep SUMMARY | sed -e 's/SUMMARY\://g' | sed -e 's/\ -\ Inspection//g'`
sed -i "/SUMMARY:*/a LOCATION:$ADDRESS" $1
/usr/local/bin/gcalcli --calendar "House Inspections" import $1 && rm $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment