aboutsummaryrefslogtreecommitdiff
path: root/share/keyringer/del
blob: c6993949cb0a68c88d1f139a4f257cc047e4b3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#
# Remove files.
#

# Load functions
LIB="`dirname $0`/../../lib/keyringer/functions"
source $LIB
keyringer_set_env $*

# Aditional parameters
FILE="`keyringer_filename $2`"

# Setup
if [ -z "$FILE" ]; then
  echo "Usage: keyringer <keyring> `basename $0` <file>"
  exit 1
elif [ ! -f "$KEYDIR/$FILE" ]; then
  echo "File not found: $KEYDIR/$FILE"
  exit 1
fi

# Remove
if [ -d "$KEYDIR/.git" ]; then
  ./git $KEYDIR rm $FILE --force
fi