Created
April 28, 2011 01:55
-
-
Save qichunren/945650 to your computer and use it in GitHub Desktop.
运用expect自动输入密码
This file contains hidden or 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
qichunren@ubuntu:~/repos$ cat auto_pull.sh | |
#!/usr/bin/expect | |
set timeout 30 | |
cd /home/qichunren/repos/web_backend | |
spawn git pull --rebase | |
expect "[email protected]'s password:" | |
send "secretpassword\r" | |
send "\r" | |
sleep 10 | |
interact | |
# crontab -l | |
*/10 * * * * /home/qichunren/repos/auto_pull.sh >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment