Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- USER1=_parsefromfile_
- HOST1=_parsefromfile_
- PW1=_parsefromfile_
- USER2=_parsefromfile_
- HOST2=_parsefromfile_
- PW2=_parsefromfile_
- imapsync
- --buffersize 8192000 --nosyncacls --subscribe --syncinternaldates --IgnoreSizeErrors
- --host1 $HOST1 --user1 $USER1 --password1 $PW1 --ssl1 --port1 993 --noauthmd5
- --host2 $HOST2 --user2 $USER2 --password2 $PW2 --ssl2 --port2 993 --noauthmd5 --allowsizemismatch
- host1 user1 password1 host2 user2 password2
- anotherhost1 anotheruser1 anotherpassword1 anotherhost2 anotheruser2 anotherpassword2
- USER=joe
- PASS=hello
- SERVER=127.0.0.2
- #!/bin/bash
- # Set defaults
- USER=`whoami`
- # Load config values
- source config.conf
- foobar2000 --user=$USER --pass=$PASS --HOST=$HOST
- source file.sh
- . file.sh
- #!/bin/bash
- configfile=/pathtocontrolfile
- cat $configfile | while read -a HR ; do
- [[ -z ${HR[0]} ]] && continue # skip empty lines
- USER1=${HR[0]}
- HOST1=${HR[1]}
- PW1=${HR[2]}
- USER2=${HR[3]}
- HOST2=${HR[4]}
- PW2=${HR[5]}
- imapsync
- --buffersize 8192000 --nosyncacls --subscribe --syncinternaldates --IgnoreSizeErrors
- --host1 $HOST1 --user1 $USER1 --password1 $PW1 --ssl1 --port1 993 --noauthmd5
- --host2 $HOST2 --user2 $USER2 --password2 $PW2 --ssl2 --port2 993 --noauthmd5 --allowsizemismatch
- done
- #!/bin/bash
- while getopts ":a" opt; do
- case $opt in
- a)
- echo "-a was triggered!" >&2
- ;;
- ?)
- echo "Invalid option: -$OPTARG" >&2
- ;;
- esac
- done
- $ ./go_test.sh -a
- -a was triggered!
- $
- if [ -f $SETTINGS_FILE ];then
- . $SETTINGS_FILE
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement