More permissions setting before gpg user commands

This commit is contained in:
Bob Mottram 2017-06-24 19:04:37 +01:00
parent 98d4179784
commit b75b6aafe1
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,7 @@ function gpg_export_public_key {
key_id=$2
key_filename=$3
chown -R $key_username:$key_username /home/$key_username/.gnupg
su -m root -c "gpg --homedir /home/$key_username/.gnupg --output $key_filename --armor --export $key_id" - $key_username
}
@ -73,6 +74,7 @@ function gpg_export_private_key {
key_id=$2
key_filename=$3
chown -R $key_username:$key_username /home/$key_username/.gnupg
su -m root -c "gpg --homedir=/home/$key_username/.gnupg --armor --output $key_filename --export-secret-key $key_id" - $key_username
}