Skip to content

Commit

Permalink
Update installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
clcain committed Oct 27, 2019
1 parent d8f9ccb commit 1df67a8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
14 changes: 9 additions & 5 deletions README.md
@@ -1,14 +1,18 @@
# bash-2fa
A super simple 2 factor authentication code (TOTP) generator front-end for oathtool using Bash.

A super simple 2 factor authentication code (TOTP) generator front-end for oathtool using Bash.
Requires installation of oathtool (available from oath-toolkit).

## Installation
1. Install oath-toolkit (e.g. `sudo apt install oath-toolkit`) and ensure that `oathtool` can be run from the command line.
2. Navigate to the src/ directory.
3. Run `bash install.sh` (sudo password will be required to copy exectuable into `/usr/local/bin`)

1. Install oath-toolkit (`sudo apt install oath-toolkit`)
3. Run the installation srcipt (`bash install.sh`)
4. Ensure that ~/bin/ is in your PATH variable.

## Configuration

Configure your tokens in `~/.bash-2fa/tokens.conf`. Use the existing tempalate for fomatting.

## Usage
If token_name is configured with a key in `~/.bash-2fa/tokens.conf`, run `2fa token_name` will return a 2FA code for this token.

If [token_name] is configured with a key in `~/.bash-2fa/tokens.conf`, running `2fa [token_name]` will return a 2FA code for this token.
3 changes: 3 additions & 0 deletions install.sh
@@ -0,0 +1,3 @@
ln -s -f $PWD/src/2fa.sh ~/bin/2fa
mkdir -p ~/.bash-2fa
if [ ! -e ~/.bash-2fa/tokens.conf ]; then cp tokens.conf ~/.bash-2fa/; fi
5 changes: 0 additions & 5 deletions src/install.sh

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions uninstall.sh
@@ -0,0 +1,2 @@
rm -f ~/bin/2fa
rm -rf ~/.bash-2fa

0 comments on commit 1df67a8

Please sign in to comment.