wip
This commit is contained in:
@@ -20,23 +20,24 @@ fi
|
||||
if ! [[ -d "$trg_ssh_dir" ]]; then
|
||||
echo "creating non-existing target dir '${trg_ssh_dir}'."
|
||||
mkdir -p ${trg_ssh_dir}
|
||||
chmod 0700 ${trg_ssh_dir}
|
||||
fi
|
||||
|
||||
files=$(shopt -s nullglob dotglob; echo ${trg_ssh_dir}/*.pub)
|
||||
if (( ${#files} ))
|
||||
then
|
||||
echo "*.pub already exist in ${trg_ssh_dir}"
|
||||
echo "*.pub file(s) already exist in ${trg_ssh_dir}"
|
||||
else
|
||||
echo "deploy .pub file"
|
||||
echo "deploy .pub file(s)"
|
||||
cp ${src_ssh_dir}/*.pub ${trg_ssh_dir}
|
||||
fi
|
||||
|
||||
files=$(shopt -s nullglob dotglob; echo ${trg_ssh_dir}/*.gpg)
|
||||
if (( ${#files} ))
|
||||
then
|
||||
echo "*.gpg already exist in ${trg_ssh_dir}"
|
||||
echo "*.gpg file(s) already exist in ${trg_ssh_dir}"
|
||||
else
|
||||
echo "deploy .gpg file"
|
||||
echo "deploy .gpg file(s)"
|
||||
cp ${src_ssh_dir}/*.gpg ${trg_ssh_dir}
|
||||
fi
|
||||
|
||||
@@ -55,6 +56,7 @@ if [[ ${user_input} == "y" ]]; then
|
||||
|
||||
gpg -d ${trg_ssh_dir}/${filename}.gpg > ${trg_ssh_dir}/${filename}
|
||||
chmod 0600 ${trg_ssh_dir}/${filename} # id_rsa can not be accessible by other users
|
||||
trash-put ${trg_ssh_dir}/${filename}.gpg
|
||||
done
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user