diff --git a/README.md b/README.md index 4a38390..557a1f3 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,35 @@ -man -=== - -[NAME](#NAME) - [SYNOPSIS](#SYNOPSIS) - [DESCRIPTION](#DESCRIPTION) - [OPTIONS](#OPTIONS) - [ENVIRONMENT](#ENVIRONMENT) - [DEPENDENCIES](#DEPENDENCIES) - [SEE ALSO](#SEE%20ALSO) - [BUGS](#BUGS) - [AUTHOR](#AUTHOR) - [COPYRIGHT](#COPYRIGHT) +# accountmanager.sh ------------------------------------------------------------------------ -NAME ----- +## NAME accountmanager.sh − source all functionality into the current shell General purpose functions: - random − create a non blocking stream of random data on stdout - rand\_printable − create a random string a printable characters + - random − create a non blocking stream of random data on stdout + - rand\_printable − create a random string a printable characters Database management functions: - amngrdbinit − initialize the SQLite account database - amngrdbdestroy − remove the SQLite account database + - amngrdbinit − initialize the SQLite account database + - amngrdbdestroy − remove the SQLite account database Account management functions: - amngradd − add an account credential to the database - amngrcreate − create a new account credential to the database - amngrcrypt − crypt the given data with GnuPG - amngrdelete − delete an account - amngrgen − generate a encrypted random passphrase - amngrgetoldpass − copy previous password of account to X clipboard - amngrgetolduser − copy previous username of account to X clipboard - amngrgetpass − copy active password of account to X clipboard - amngrgetuser − copy active username of account to X clipboard - amngrid − write the database id of a given account name to stdout - amngrlist − list all accounts - amngrrename − rename an account - amngrsearch − pattern search accounts - -SYNOPSIS --------- + - amngradd − add an account credential to the database + - amngrcreate − create a new account credential to the database + - amngrcrypt − crypt the given data with GnuPG + - amngrdelete − delete an account + - amngrgen − generate a encrypted random passphrase + - amngrgetoldpass − copy previous password of account to X clipboard + - amngrgetolduser − copy previous username of account to X clipboard + - amngrgetpass − copy active password of account to X clipboard + - amngrgetuser − copy active username of account to X clipboard + - amngrid − write the database id of a given account name to stdout + - amngrlist − list all accounts + - amngrrename − rename an account + - amngrsearch − pattern search accounts + +## SYNOPSIS source **${PATH}/accountmanager.sh** @@ -55,10 +41,10 @@ source **${PATH}/accountmanager.sh** **amngrdbdestroy** \[*dbfile*\] -**amngradd -u** *username* **-p** *password* \[**-d** *description*\] +**amngradd** **-u** *username* **-p** *password* \[**-d** *description*\] \[**-D** *dbfile*\] \[**-r** *recipient*\] *account* -**amngrcreate -u** *username* \[**-d** *description*\] \[**-D** +**amngrcreate** **-u** *username* \[**-d** *description*\] \[**-D** *dbfile*\] \[**-r** *recipient*\] *account* **amngrcrypt** \[**-r** *recipient*\] *password* @@ -83,35 +69,22 @@ source **${PATH}/accountmanager.sh** **amngrsearch** \[**-s** *separator*\] *pattern* -DESCRIPTION ------------ +## DESCRIPTION This file can either be source into the current shell or used as a standalone shell script via the provided symlinks. When used as standalone script it will detect the function to call by the content of -**$0**. - All *account* as well as all *username* arguments used below are +**$0**. + +All *account* as well as all *username* arguments used below are limited to 128 characters. The *account* argument is always a unique string identifier for the account to manage. The *username* argument is the username part of a credential which is a (*username*, *password*) pair. - ------ - - - - - - - - -

random

Takes no arguments and connect a non blocking random source to stdout.

+**random** + +Takes no arguments and connect a non blocking random source to stdout. **rand\_printable** \[*len*\] @@ -121,7 +94,7 @@ to 255, single and double quotes are filtered. The single and double quotes are filtered to prevent problems when they are used as string separators after shell expansion as in the SQL here documents used to communicate with the SQLite database. - The optional *len* argument specifies the string length to be written +The optional *len* argument specifies the string length to be written and defaults to 512. **amngrdbinit** \[*dbfile*\] @@ -137,8 +110,7 @@ given it specifies the fill path to the file to use, else the value of **$AMNGRDB** environment variable is used. **amngradd -u** *username* **-p** *password* \[**-d** *description*\] -\[**-D** *dbfile*\] \[**-r** * - recipient*\] *account* +\[**-D** *dbfile*\] \[**-r** *recipient*\] *account* Adds an account credential and marks it as active. If the account already exist, the credential (*username* and *password*) is added to @@ -146,28 +118,27 @@ that account and the previously added credential is marked as old. If there was another even older credential that was already marked as old this will be marked as inactive and this becomes inaccessible with this tools (except for **amngrdelete**). - The necessary option **-u** specifies the username to be stored with +The necessary option **-u** specifies the username to be stored with this credential pair. - The also necessary option **-p** specifies the password to be stored +The also necessary option **-p** specifies the password to be stored and the length of *password* is not limited at all. - With option **-d** one can add a *description* to the account entry. +With option **-d** one can add a *description* to the account entry. One can specify the *dbfile* with the option **-D** if that option is not given the **$AMNGRDB** environment variable is used. **amngrcreate -u** *username* \[**-d** *description*\] \[**-D** -*dbfile*\] \[**-r** *recipient*\] * - account* +*dbfile*\] \[**-r** *recipient*\] *account* This will create a password with **amngrgen** and use that to add an credential via **amngradd**. (See there for options description) - The added password will be copied to the X clipboard with +The added password will be copied to the X clipboard with **amngrgetpass** for further use. **amngrcrypt** \[**-r** *recipient*\] *password* Crypt the given plain text *password* with GnuPG and write it to stdout. - The option **-r** specifies the recipient to use with the call to +The option **-r** specifies the recipient to use with the call to **gpg**. If it is not given the value of the **$AMNGRID** environment variable is used. @@ -224,62 +195,23 @@ List accounts where *pattern* exists in either the account name, the username or the account description. The output is like the one described with **amngrlist**. -OPTIONS -------- +## OPTIONS The options are consistent over all sub commands. However not all sub commands use all options and some sub commands take arguments that other get per option. (See **DESCRIPTION**) - ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-u

The login username of the credential for the account.

-p

The plain text password of the credential for the account.

-d

The description for the account.

-D

Select the database file to use instead of the one defined in the $AMNGRDB environment variable.

-r

Select a recipient id for GnuPG encryption to use instead of the one defined in the $AMNGRID environment variable.

-s

The column separator for the amngrlist and amngrsearchcommands.

- -ENVIRONMENT ------------ + - **-u** The login username of the credential for the account. + - **-p** The plain text password of the credential for the account. + - **-d** The description for the account. + - **-D** Select the database file to use instead of the one defined in the + **$AMNGRDB** environment variable. + - **-r** Select a recipient id for GnuPG encryption to use instead of the one + defined in the **$AMNGRID** environment variable. + - **-s** The column separator for the **amngrlist** and + **amngrsearchcommands**. + +## ENVIRONMENT **AMNGRDB** @@ -298,8 +230,7 @@ option. The password length to be used when generating new passwords. -DEPENDENCIES ------------- +## DEPENDENCIES A set of POSIX compliant shell utilities including a POSIX compliant shell as well are needed to run this script. @@ -313,150 +244,45 @@ The existence of a reliable non blocking random source. By default this scripts use **$(cat /dev/urandom)** which can be changed by replacing the alias **random** with something useful for your system. -For data storage **Sqlite >= 3.6.19** is required. The version +For data storage **Sqlite >= 3.6.19** is required. The version requirement comes from the use of foreign key constraints. To store the data within the X clipboard the **xclip** is needed. **The tools used are** - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

awk

basename

cat

dnsdomainname

echo

getopts

gpg

head

printf

rm

shift

SQLite3 (>= 3.6.19 for foreign key constraints)

test and [

tr

xclip

- -SEE ALSO --------- + - **awk** + - **basename** + - **cat** + - **dnsdomainname** + - **echo** + - **getopts** + - **gpg** + - **head** + - **printf** + - **rm + - **shift** + - **SQLite3** (>= 3.6.19 for foreign key constraints) + - **test** and **[** + - **tr** + - **xclip** + +## SEE ALSO gpg2(1), gpg-agent(1) -BUGS ----- +## BUGS No known bugs. -AUTHOR ------- +## AUTHOR Georg Hopp (georg@steffers.org.in) -COPYRIGHT ---------- +## COPYRIGHT Copyright © 2017 Georg Hopp License GPLv3+: GNU GPL version 3 or later -<http://gnu.org/licenses/gpl.html>. +. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.