Advertisement
Guest User

Untitled

a guest
Jan 24th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #!/bin/sh
  2. USER1=_parsefromfile_
  3. HOST1=_parsefromfile_
  4. PW1=_parsefromfile_
  5. USER2=_parsefromfile_
  6. HOST2=_parsefromfile_
  7. PW2=_parsefromfile_
  8.  
  9. imapsync
  10. --buffersize 8192000 --nosyncacls --subscribe --syncinternaldates --IgnoreSizeErrors
  11. --host1 $HOST1 --user1 $USER1 --password1 $PW1 --ssl1 --port1 993 --noauthmd5
  12. --host2 $HOST2 --user2 $USER2 --password2 $PW2 --ssl2 --port2 993 --noauthmd5 --allowsizemismatch
  13.  
  14. host1 user1 password1 host2 user2 password2
  15. anotherhost1 anotheruser1 anotherpassword1 anotherhost2 anotheruser2 anotherpassword2
  16.  
  17. USER=joe
  18. PASS=hello
  19. SERVER=127.0.0.2
  20.  
  21. #!/bin/bash
  22.  
  23. # Set defaults
  24. USER=`whoami`
  25.  
  26. # Load config values
  27. source config.conf
  28.  
  29. foobar2000 --user=$USER --pass=$PASS --HOST=$HOST
  30.  
  31. source file.sh
  32. . file.sh
  33.  
  34. #!/bin/bash
  35. configfile=/pathtocontrolfile
  36. cat $configfile | while read -a HR ; do
  37.  
  38. [[ -z ${HR[0]} ]] && continue # skip empty lines
  39.  
  40. USER1=${HR[0]}
  41. HOST1=${HR[1]}
  42. PW1=${HR[2]}
  43. USER2=${HR[3]}
  44. HOST2=${HR[4]}
  45. PW2=${HR[5]}
  46.  
  47. imapsync
  48. --buffersize 8192000 --nosyncacls --subscribe --syncinternaldates --IgnoreSizeErrors
  49. --host1 $HOST1 --user1 $USER1 --password1 $PW1 --ssl1 --port1 993 --noauthmd5
  50. --host2 $HOST2 --user2 $USER2 --password2 $PW2 --ssl2 --port2 993 --noauthmd5 --allowsizemismatch
  51.  
  52. done
  53.  
  54. #!/bin/bash
  55.  
  56. while getopts ":a" opt; do
  57. case $opt in
  58. a)
  59. echo "-a was triggered!" >&2
  60. ;;
  61. ?)
  62. echo "Invalid option: -$OPTARG" >&2
  63. ;;
  64. esac
  65. done
  66.  
  67.  
  68. $ ./go_test.sh -a
  69. -a was triggered!
  70. $
  71.  
  72. if [ -f $SETTINGS_FILE ];then
  73. . $SETTINGS_FILE
  74. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement