summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-10 12:52:56 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-10 12:52:56 -0200
commit60603e9479414a67f96849f99851ef2749693f49 (patch)
tree00a124373ea5b0b53347a989b8df016bd8f196c0 /lib
parentf2334e9e16bc2aa85a619e606cc2a38211544675 (diff)
downloadkeyringer-60603e9479414a67f96849f99851ef2749693f49.tar.gz
keyringer-60603e9479414a67f96849f99851ef2749693f49.tar.bz2
Initial implementation for keyringer shell (#34)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/shell18
1 files changed, 18 insertions, 0 deletions
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