blob: 436b1ca38a4e24c5e1bd2f491f6cd1cb3a915bfe (
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
27
28
29
30
31
|
#!/bin/bash
#
# Append information into encrypted files.
#
# Load functions
LIB="`dirname $0`/../../lib/keyringer/functions"
source $LIB || exit 1
# Get file
keyringer_get_file $2
OLDIFS=$IFS
IFS=$'\n'
CONTENT=($(keyringer_exec decrypt $BASEDIR $FILE))
echo " "
echo "$FILE currently has ${#CONTENT[@]} lines"
echo " "
echo "Now please write the content to be appended on $FILE, finnishing with Ctrl-D:"
APPEND=($(cat -))
NEW=( ${CONTENT[@]} ${APPEND[@]} )
for element in $(seq 0 $((${#NEW[@]} - 1))); do
echo ${NEW[$element]}
done | keyringer_exec encrypt $BASEDIR $FILE
IFS="$OLDIFS"
|