#!/bin/bash datestamp=$(date +%Y_%m_%d_%H_%M_%S) cp /home/phablet/.local/share/evolution/calendar/system/calendar.ics "/home/phablet/.local/share/evolution/calendar/system/calendar.ics.${datestamp}" curl -q --header 'Host: cal.thekyel.com' --header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --header 'DNT: 1' --header 'Cookie: PHPSESSID=87as3k4t2oslp2tr8v4406bmgvjduoj0a0; webcalendar_session=cdebll4ll4ll4ll4d1d3e4e48e4739cc6l4bddcch784af8ec6ksale8364b24aa87d7148d8ada5ddc3k2ld2d49da0d545asdf-; webcalendar_login=user; webcalendar_csscache=5; webcalendar_last_view=%2Fmonth.php' --header 'Authorization: Basic a3ksa92lslllbHc6RDV1YCfiqLJSAKXVRRDxUemasd-9ddQw==' --header 'Connection: keep-alive' 'https://cal.thekyel.com/tools/icalclient.php' -o '/tmp/kyelw.ics' -s -J -L if [ ! -f /tmp/kyelw.ics ]; then echo "could not find vcard file" exit 1 else mv /tmp/kyelw.ics /home/phablet/.local/share/evolution/calendar/system/calendar.ics fi