Created
June 12, 2011 21:41
-
-
Save saghul/1022020 to your computer and use it in GitHub Desktop.
imapfilter + expect automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_exit() { | |
echo "CTRL + C pressed, exiting." | |
exit 0 | |
} | |
trap _exit INT | |
read -p "Password: " -s PASSWORD | |
while [[ true ]]; do | |
expect -c " | |
spawn imapfilter -v -c ag-projects.lua | |
expect { | |
"*password*:" { send $PASSWORD\r\n; interact } | |
eof { exit } | |
} | |
exit | |
" | |
echo "Something went wrong with imapfilter, will restart in 5 seconds." | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment