Created
June 12, 2023 12:20
-
-
Save melmatsuoka/7c8bee12c64096d462db128633b7c3da to your computer and use it in GitHub Desktop.
This automatically outputs the concatenated OTP+Password that the OPNsense admin login fields expects when you're using a 2FA protected account. Requires 1Password CLI
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/env bash | |
vault_item_uuid="YOUR VAULT ITEM UUID" | |
opnsense_otp=$(op item get ${vault_item_uuid} --otp) | |
opnsense_pwd=$(op item get ${vault_item_uuid} --fields password) | |
# "pbcopy" is a macOS only built-in that copies whatever was piped to it to the system clipboard | |
echo -n "$opnsense_otp$opnsense_pwd" | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment