Advertisement
Guest User

Untitled

a guest
Jul 19th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 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. CONTACTS_URL=" " # add the carddav URL here
  8. USERNAME=" " # you know this one
  9. PASSWORD=" " # lots of ******
  10.  
  11. # ----------------- [ Phone ] ----------------- #
  12. CONFIG_NAME=" " # I use "myCloud"
  13. CONTACTS_NAME=" " # I use "personalcontacts"
  14. CONTACTS_VISUAL_NAME=" " # you can choose a nice name to show on the contacts app like "OwnContacts"
  15. CRON_FREQUENCY= " " # I use "hourly"
  16.  
  17.  
  18. #Create contact list
  19. syncevolution --create-database backend=evolution-contacts database=$CONTACTS_VISUAL_NAME
  20. #Create Peer
  21. syncevolution --configure --template webdav username=$USERNAME password=$PASSWORD syncURL=$CONTACTS_URL keyring=no target-config@$CONFIG_NAME
  22. #Create New Source
  23. syncevolution --configure backend=evolution-contacts database=$CONTACTS_VISUAL_NAME @default $CONTACTS_NAME
  24. #Add remote database
  25. syncevolution --configure database=$CONTACTS_URL backend=carddav target-config@$CONFIG_NAME $CONTACTS_NAME
  26. #Connect remote contact list with local databases
  27. syncevolution --configure --template SyncEvolution_Client Sync=None syncURL=local://@$CONFIG_NAME $CONFIG_NAME $CONTACTS_NAME
  28. #Add local database to the source
  29. syncevolution --configure sync=two-way backend=evolution-contacts database=$CONTACTS_VISUAL_NAME $CONFIG_NAME $CONTACTS_NAME
  30. #Start first sync
  31. syncevolution --sync refresh-from-remote $CONFIG_NAME $CONTACTS_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