dotfiles

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

totp.sh (424B)


      1#!/bin/sh
      2CONFIGURATION="$HOME/Desktop/totp_key.txt"
      3if [ -z $1 ]; then
      4  echo "Usage:"
      5  echo "   otp google"
      6  echo
      7  echo "Configuration: $CONFIGURATION"
      8  echo "Format: name=key"
      9  echo "Services:"
     10  sed 's/=.*//; s/^/   /' $CONFIGURATION
     11  echo
     12  exit
     13fi
     14OTPKEY="$(sed -n "s/${1}=//p" $CONFIGURATION)"
     15if [ -z "$OTPKEY" ]; then
     16  echo "$(basename $0): Bad Service Name '$1'"
     17  $0
     18  exit
     19fi
     20oathtool --totp -b "$OTPKEY"