mirror of
https://github.com/dustinkirkland/byobu.git
synced 2025-03-12 04:35:50 -07:00
* usr/bin/vigpg:
- get vigpg working with the new release of gpg in wily - clean up encrypted copies of the file
This commit is contained in:
parent
7dc2d92302
commit
365158b50f
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -2,6 +2,9 @@ byobu (5.98) unreleased; urgency=medium
|
|||||||
|
|
||||||
* usr/bin/vigpg:
|
* usr/bin/vigpg:
|
||||||
- specify stdin for input file
|
- specify stdin for input file
|
||||||
|
* usr/bin/vigpg:
|
||||||
|
- get vigpg working with the new release of gpg in wily
|
||||||
|
- clean up encrypted copies of the file
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 31 Aug 2015 13:32:38 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 31 Aug 2015 13:32:38 -0500
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ set -e
|
|||||||
cleartext_file=$(mktemp /dev/shm/.vigpg-XXXXXXXXXXXX)
|
cleartext_file=$(mktemp /dev/shm/.vigpg-XXXXXXXXXXXX)
|
||||||
|
|
||||||
# Ensure that we always remove the cleartext_file on any exit
|
# Ensure that we always remove the cleartext_file on any exit
|
||||||
trap "shred -f ${cleartext_file} "$cleartext_file".gpg 2>/dev/null || true" EXIT HUP INT QUIT TERM
|
trap "shred -f ${cleartext_file} ${cleartext_file}.gpg 2>/dev/null || true" EXIT HUP INT QUIT TERM
|
||||||
|
|
||||||
# Encrypted file from argv
|
# Encrypted file from argv
|
||||||
encrypted_file="$1"
|
encrypted_file="$1"
|
||||||
@ -48,7 +48,8 @@ fi
|
|||||||
|
|
||||||
# Try to decrypt the target file
|
# Try to decrypt the target file
|
||||||
if [ -e "$encrypted_file" ]; then
|
if [ -e "$encrypted_file" ]; then
|
||||||
(cat "$encrypted_file" | gpg -d - > "$cleartext_file") || error "Unable to decrypt target"
|
rm -f "$cleartext_file"
|
||||||
|
gpg -o "$cleartext_file" -d "$encrypted_file" || error "Unable to decrypt target"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Grab a checksum of the cleartext data before modification
|
# Grab a checksum of the cleartext data before modification
|
||||||
@ -72,3 +73,4 @@ else
|
|||||||
echo
|
echo
|
||||||
echo "The encrypted file was not modified [$encrypted_file]"
|
echo "The encrypted file was not modified [$encrypted_file]"
|
||||||
fi
|
fi
|
||||||
|
rm -f "$cleartext_file" "$cleartext_file".gpg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user