aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/find
blob: 45b4f11557cdf1d8f4aff1dc2181f31820fef774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
#
# Find secrets.
#

# Load functions
LIB="`dirname $0`/../functions"
source "$LIB" maintenance $* || exit 1

# Aditional parameters
CWD="`pwd`"

# Avoid leading slash
shift
ARGS="`echo "$*" | sed -e "s|^/*||"`"

# Run find command
cd "$KEYDIR/$RELATIVE_PATH" && find ./ | grep -i "$ARGS" | sed -e 's|^./||g'
cd "$CWD"