You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
490 B
31 lines
490 B
3 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
|
||
|
USERNAME="${CORPUSER}"
|
||
|
PASS="${CORPPASS}"
|
||
|
|
||
|
PASSCOMMAND="${CORPPASSCOMMAND}"
|
||
|
|
||
|
get_username(){
|
||
|
if [ -z "$USERNAME" ]; then
|
||
|
read -p "Corp Username: " USERNAME < /dev/tty
|
||
|
fi
|
||
|
echo $USERNAME
|
||
|
return 0
|
||
|
}
|
||
|
|
||
|
get_password(){
|
||
|
if [ -z "$PASS" ]; then
|
||
|
if [ -n "$CORPPASSCOMMAND" ]; then
|
||
|
PASS=$(eval $PASSCOMMAND)
|
||
|
else
|
||
|
read -p "Corp Password: " -s PASS < /dev/tty
|
||
|
fi
|
||
|
fi
|
||
|
echo $PASS
|
||
|
return 0
|
||
|
}
|
||
|
|
||
|
|
||
|
http --auth-type=ntlm --auth="$(get_username):$(get_password)" "$@"
|