Updated vns_import to use vns_gpgid, as well as create nonexistent paths
This commit is contained in:
13
vns
13
vns
@@ -301,10 +301,17 @@ vns_import () {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%s:" "Specify GPG Public Key: "
|
#printf "%s:" "Specify GPG Public Key: "
|
||||||
local gpg_key=''; read -r gpg_key
|
#local gpg_key=''; read -r gpg_key
|
||||||
|
|
||||||
gpg2 --batch -r "$gpg_key" -o "$VNS_STORE/$2.gpg" -e "$1"
|
# Create any necessary directories
|
||||||
|
mkdir -p "$VNS_STORE/$(dirname "$2.gpg")"
|
||||||
|
|
||||||
|
if [ "${1##*.}" == "gpg" ]; then
|
||||||
|
gpg --batch --decrypt "$1" | gpg2 --batch "$(vns_gpgid)" -o "$VNS_STORE/$2.gpg" --encrypt
|
||||||
|
else
|
||||||
|
gpg2 --batch "$(vns_gpgid)" -o "$VNS_STORE/$2.gpg" --encrypt "$1"
|
||||||
|
fi
|
||||||
|
|
||||||
vns_git add "$VNS_STORE/$2.gpg"
|
vns_git add "$VNS_STORE/$2.gpg"
|
||||||
vns_git commit -m "Imported file $1 as $2"
|
vns_git commit -m "Imported file $1 as $2"
|
||||||
|
|||||||
Reference in New Issue
Block a user