From 60603e9479414a67f96849f99851ef2749693f49 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 12:52:56 -0200 Subject: Initial implementation for keyringer shell (#34) --- lib/keyringer/actions/shell | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 lib/keyringer/actions/shell (limited to 'lib/keyringer/actions') diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell new file mode 100755 index 0000000..c70d6bb --- /dev/null +++ b/lib/keyringer/actions/shell @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Interactive shell. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# While a "quit" command isn't entered, read STDIN +while read -rep "keyringer:/> " STDIN; do + if [ "$STDIN" == "quit" ]; then + break + # If line is not empty or commented, process command + elif [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then + keyringer "$KEYRING" $STDIN + fi +done -- cgit v1.2.3