-
-
Save nobiki/ba7458ed2026fbd7805d655a6f6989a7 to your computer and use it in GitHub Desktop.
面倒な認証とかをexpectで自動化するスクリプト(例: rim git clone https://〜)
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 | |
ARGS=$@ | |
# match command only | |
if [ "git" == ${1} ]; then | |
expect -c " | |
set timeout 60 | |
spawn ${ARGS} | |
while (1) { | |
expect \"Password for\" { | |
send \"[password here.]\r\" | |
} | |
} | |
" | |
fi | |
# grep username and hostname | |
# if [ "git" == ${1} -a `git config --list | grep "[username here.]@[hostname here.]"` ]; then | |
# expect -c " | |
# set timeout 60 | |
# | |
# spawn ${ARGS} | |
# | |
# while (1) { | |
# expect \"Password for\" { | |
# send \"[password here.]\r\" | |
# } | |
# } | |
# " | |
# fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment