diff --git a/README.md b/README.md index a826e6d..406cdb9 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,10 @@ sudo ln -s ~/.lazy-connect/lazy-connect /usr/local/bin/lazy-connect lazy-connect - Shell function to fuzzy search an IPSec VPN by name and connect to it automatically. --i - Initialize lazy-connect. - Stores the secret and VPN list to ~/.config/lazy-connect/ --r - refresh vpn list in ~/.config/lazy-connect --h - Show this help +-i - Initialize lazy-connect. Stores the TOTP secret and VPN list. +-r - Refresh vpn list in ~/.config/lazy-connect . +-n - Do not fill the password automatically. Instead copy the password to clipboard. +-h - Show this help. ``` ### YubiKey Support diff --git a/lazy-connect b/lazy-connect index 34e756d..f200c2d 100755 --- a/lazy-connect +++ b/lazy-connect @@ -64,9 +64,10 @@ USAGE: lazy-connect - Shell function to fuzzy search an IPSec VPN by name and connect to it automatically. --i - Initialize lazy-connect. Stores the TOTP secret and VPN list --r - Refresh vpn list in ~/.config/lazy-connect --h - Show this help +-i - Initialize lazy-connect. Stores the TOTP secret and VPN list. +-r - Refresh vpn list in ~/.config/lazy-connect . +-n - Do not fill the password automatically. Instead copy the password to clipboard. +-h - Show this help. EOF } @@ -95,6 +96,7 @@ function _lazy_connect_get_totp() { function _lazy_connect() { vpn_name=$1 _lazy_connect_get_totp $2 + local autofill=$3 if [ -z "$password" ]; then case $TOTP_MODE in @@ -107,19 +109,23 @@ function _lazy_connect() { return 1 ;; esac + elif [ "$autofill" == "false" ]; then + echo -n "$password" | pbcopy fi osascript <