Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #!/bin/bash
  2. # Simplified by me, Tiago Carrondo <tcarrondo@ubuntu.com>
  3. # Thanks to: Romain Fluttaz <romain@botux.fr>
  4. # Thanks to: Wayne Ward <info@wayneward.co.uk>
  5. # Thanks to: Mitchell Reese <mitchell@curiouslegends.com.au>
  6. # --------------- [ Server ] ---------------- #
  7. CAL_URL=" " # add the caldav URL here
  8. USERNAME=" " # you know this one
  9. PASSWORD=" " # lots of ******
  10.  
  11. # ----------------- [ Phone ] ----------------- #
  12. CONFIG_NAME=" " # I use "myCloud"
  13. CALENDAR_NAME=" " # I use "personalcalendar"
  14. CALENDAR_VISUAL_NAME=" " # you can choose a nice name to show on the calendar app like "OwnCalendar"
  15. CRON_FREQUENCY= " " # I use "hourly"
  16.  
  17.  
  18. #Create Calendar
  19. syncevolution --create-database backend=evolution-calendar database=$CALENDAR_VISUAL_NAME
  20. #Create Peer
  21. syncevolution --configure --template webdav username=$USERNAME password=$PASSWORD syncURL=$CAL_URL keyring=no target-config@$CONFIG_NAME
  22. #Create New Source
  23. syncevolution --configure backend=evolution-calendar database=$CALENDAR_VISUAL_NAME @default $CALENDAR_NAME
  24. #Add remote database
  25. syncevolution --configure database=$CAL_URL backend=caldav target-config@$CONFIG_NAME $CALENDAR_NAME
  26. #Connect remote calendars with local databases
  27. syncevolution --configure --template SyncEvolution_Client syncURL=local://@$CONFIG_NAME $CONFIG_NAME $CALENDAR_NAME
  28. #Add local database to the source
  29. syncevolution --configure sync=two-way database=$CALENDAR_VISUAL_NAME $CONFIG_NAME $CALENDAR_NAME
  30. #Start first sync
  31. syncevolution --sync refresh-from-remote $CONFIG_NAME $CALENDAR_NAME
  32.  
  33. #Add Sync Cronjob
  34. sudo mount / -o remount,rw
  35. CRON_LINE="@$CRON_FREQUENCY export DISPLAY=:0.0 && export DBUS_SESSION_BUS_ADDRESS=$(ps -u phablet e | grep -Eo 'dbus-daemon.*address=unix:abstract=/tmp/dbus-[A-Za-z0-9]{10}' | tail -c35) && /usr/bin/syncevolution $CONFIG_NAME"
  36. (crontab -u phablet -l; echo "$CRON_LINE" ) | crontab -u phablet -
  37. sudo mount / -o remount,ro
  38. sudo service cron restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement