totp

Simple cli tool for storing TOTP secrets and generating tokens
git clone https://git.inz.fi/totp/
Log | Files | Refs | Submodules

commit cde8057f11a99cdf39a244754d7f189f455011b8
parent fb3a7c227e03c7f6436254f45f2768ab8ab8842b
Author: Santtu Lakkala <santtu.lakkala@digital14.com>
Date:   Thu, 28 Sep 2023 15:36:55 +0300

Improve POSIX compatibility

Diffstat:
Mtests/stress.sh | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/stress.sh b/tests/stress.sh @@ -4,12 +4,20 @@ onexit() { [ -n "$KEYFILE" ] && rm "$KEYFILE" [ -n "$DBFILE" ] && rm "$DBFILE" [ -n "$URIFILE" ] && rm "$URIFILE" + [ -n "$SEDITMP" ] && rm "$SEDITMP" } trap onexit EXIT KEYFILE="$(mktemp)" DBFILE="$(mktemp)" URIFILE="$(mktemp)" +SEDITMP="$(mktemp)" + +sedi() { + sed "$@" >"$SEDITMP" + for last in "$@"; do :; done + cat "$SEDITMP" > "$last" +} b32encode() { od -vt u1 | awk ' @@ -75,7 +83,7 @@ rand | ( 1) if ! test "$LastKey" = "$FirstKey"; then "$1" -K "$KEYFILE" -f "$DBFILE" -d "issuer$FirstKey:ident$FirstKey" - sed -i -e '1d' "$URIFILE" + sedi -e '1d' "$URIFILE" FirstKey="$((FirstKey + 1))" fi ;;