Skip to content

Instantly share code, notes, and snippets.

@qichunren
Created April 28, 2011 01:55
Show Gist options
  • Save qichunren/945650 to your computer and use it in GitHub Desktop.
Save qichunren/945650 to your computer and use it in GitHub Desktop.
运用expect自动输入密码
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