Created
November 4, 2012 16:42
-
-
Save pwenzel/4012544 to your computer and use it in GitHub Desktop.
Mount Box.net via WebDAV using Expect
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
#!/usr/bin/expect | |
# set variables | |
set username [email protected] | |
set password changeme | |
set certificate_accept y | |
spawn mount -t davfs https://www.box.com/dav/ /mnt/box.net/ | |
# Look for username prompt | |
expect "username:" | |
# Send username aka $username | |
send -- "$username\r" | |
# Look for password prompt | |
expect "password:" | |
# Send password aka $password | |
send -- "$password\r" | |
# Look for certificate prompt | |
expect "Accept certificate for this session?:" | |
# Send certificate_accept aka $certificate_accept | |
send -- "$certificate_accept\r" | |
expect eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment