1
0
Fork 0
mirror of synced 2024-05-26 12:01:11 -04:00

Merge pull request #8 from esphen/master

This commit is contained in:
Tim Byrne 2016-04-21 07:33:49 -05:00
commit fbaf5b6cf4
3 changed files with 21 additions and 1 deletions

10
yadm
View file

@ -226,6 +226,14 @@ function encrypt() {
return 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 #; build a list of globs from YADM_ENCRYPT
GLOBS=() GLOBS=()
while IFS='' read -r glob || [ -n "$glob" ]; do while IFS='' read -r glob || [ -n "$glob" ]; do
@ -235,7 +243,7 @@ function encrypt() {
done < "$YADM_ENCRYPT" done < "$YADM_ENCRYPT"
#; encrypt all files which match the globs #; 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 if [ $? = 0 ]; then
echo "Wrote new file: $YADM_ARCHIVE" echo "Wrote new file: $YADM_ARCHIVE"
else else

6
yadm.1
View file

@ -292,6 +292,12 @@ This feature is enabled by default.
Disable the permission changes to Disable the permission changes to
.IR $HOME/.gnupg/* . .IR $HOME/.gnupg/* .
This feature is enabled by default. This feature is enabled by default.
.TP
.B yadm.gpg-recipient
Asymmetrically encrypt files with a gpg public/private key pair.
Provide a key ID to encrypt against that public key.
If left blank or not provided, symmetric encryption is used instead.
This feature is disabled by deafult.
.SH ALTERNATES .SH ALTERNATES
When managing a set of files across different systems, it can be useful to have When managing a set of files across different systems, it can be useful to have
an automated way of choosing an alternate version of a file for a different an automated way of choosing an alternate version of a file for a different

View file

@ -179,6 +179,12 @@
Disable the permission changes to $HOME/.gnupg/*. This feature Disable the permission changes to $HOME/.gnupg/*. This feature
is enabled by default. is enabled by default.
yadm.gpg-recipient
Asymmetrically encrypt files with a gpg public/private key pair.
Provice a key ID to encrypt against that public key.
If left blank or not provided, symmetric encryption is used
instead. This feature is disabled by deafult.
## ALTERNATES ## ALTERNATES
When managing a set of files across different systems, it can be useful When managing a set of files across different systems, it can be useful
to have an automated way of choosing an alternate version of a file for to have an automated way of choosing an alternate version of a file for