Created
March 1, 2016 03:22
-
-
Save ik9999/6c7d0763864e157241a9 to your computer and use it in GitHub Desktop.
sshfs + 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
#!/usr/bin/expect -f | |
set timeout 20 | |
spawn -ignore HUP sudo /usr/bin/sshfs SSH_LOGIN@SSH_URL:SSH_PATH DIR -p PORT -o allow_other | |
expect { | |
"sudo" { | |
send "SUDO_PASS\r" | |
exp_continue | |
} | |
"worker" { | |
send "SSH_PASS\r" | |
exp_continue | |
} | |
"\n" { } | |
default { | |
puts "def1" | |
} | |
} | |
expect { | |
"worker" { | |
send "SSH_PASS\r" | |
send_user "\n" | |
} | |
"\n" { } | |
default { | |
puts "def2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment