mirror of
https://github.com/TheLocehiliosan/yadm
synced 2026-03-02 03:49:29 +00:00
Merge pull request #8 from esphen/master
This commit is contained in:
10
yadm
10
yadm
@@ -226,6 +226,14 @@ function encrypt() {
|
||||
return
|
||||
}
|
||||
|
||||
#; Build gpg options for gpg
|
||||
GPG_KEY="$(config yadm.gpg-recipient)"
|
||||
if [ "$GPG_KEY" != "" ]; then
|
||||
GPG_OPTS="-er $GPG_KEY"
|
||||
else
|
||||
GPG_OPTS="-c"
|
||||
fi
|
||||
|
||||
#; build a list of globs from YADM_ENCRYPT
|
||||
GLOBS=()
|
||||
while IFS='' read -r glob || [ -n "$glob" ]; do
|
||||
@@ -235,7 +243,7 @@ function encrypt() {
|
||||
done < "$YADM_ENCRYPT"
|
||||
|
||||
#; encrypt all files which match the globs
|
||||
tar -cv "${GLOBS[@]}" | gpg --yes -c --output "$YADM_ARCHIVE"
|
||||
tar -cv ${GLOBS[@]} | gpg --yes "$GPG_OPTS" --output "$YADM_ARCHIVE"
|
||||
if [ $? = 0 ]; then
|
||||
echo "Wrote new file: $YADM_ARCHIVE"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user