aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/shell
blob: c70d6bb1897bb6aa82d7430275cec61d28052800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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