summaryrefslogtreecommitdiff
path: root/localsyncmail
blob: 03dc1d2880c602d092c1d88e7a71a0392a9172be (plain)
  1. #!/bin/sh
  2. me=$(whoami)
  3. user=$1
  4. if [ -n "$user" ]; then
  5. host=$2
  6. if [ -n "$host" ]; then
  7. shift 2
  8. else
  9. host=localhost
  10. shift
  11. fi
  12. else
  13. user=$me
  14. fi
  15. if [ "$user" = "$me" ] && [ "$host" = "localhost" ]; then
  16. pkill -u $user offlineimap || [ $? -lt 2 ]
  17. offlineimap $@
  18. else
  19. ssh -C -X -e none $user@$host pkill -u $user offlineimap || [ $? -lt 2 ]
  20. ssh -C -X -e none -tt $user@$host offlineimap $@
  21. fi
  22. exit 0