dotfiles

Dash Eclipse's dotfiles
git clone git://ezup.dev/dotfiles.git
Log | Files | Refs | README | LICENSE

commit 3c61fb94bc430f73a5723cc6050efdb3bf4f2e23
parent 489de33b556552566010d7aaa4e8778b6e21a964
Author: Dash Eclipse <dash@ezup.dev>
Date:   Tue,  3 Nov 2020 11:01:41 +0000

Add totp.sh

Diffstat:
A.local/bin/totp.sh | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/.local/bin/totp.sh b/.local/bin/totp.sh @@ -0,0 +1,20 @@ +#!/bin/sh +CONFIGURATION="$HOME/Desktop/totp_key.txt" +if [ -z $1 ]; then + echo "Usage:" + echo " otp google" + echo + echo "Configuration: $CONFIGURATION" + echo "Format: name=key" + echo "Services:" + sed 's/=.*//; s/^/ /' $CONFIGURATION + echo + exit +fi +OTPKEY="$(sed -n "s/${1}=//p" $CONFIGURATION)" +if [ -z "$OTPKEY" ]; then + echo "$(basename $0): Bad Service Name '$1'" + $0 + exit +fi +oathtool --totp -b "$OTPKEY"