wip
This commit is contained in:
@@ -561,8 +561,8 @@ nas() {
|
||||
sudo umount /mnt/nas-fam
|
||||
elif [[ $1 == "mount" ]] && [[ -n $2 ]]; then
|
||||
echo "mount /mnt/nas & /mnt/nas-fam"
|
||||
sudo mount -t cifs -o credentials=/home/poq/syncDir/secrets/misc/lillesorteboks.txt,iocharset=utf8,noperm //$2/fro /mnt/nas
|
||||
sudo mount -t cifs -o credentials=/home/poq/syncDir/secrets/misc/lillesorteboks.txt,iocharset=utf8,noperm //$2/fam /mnt/nas-fam
|
||||
sudo mount -t cifs -o credentials=/home/poq/syncDir/secrets/nas/lillesorteboks.txt,iocharset=utf8,noperm //$2/fro /mnt/nas
|
||||
sudo mount -t cifs -o credentials=/home/poq/syncDir/secrets/nas/lillesorteboks.txt,iocharset=utf8,noperm //$2/fam /mnt/nas-fam
|
||||
tree -L 2 /mnt/nas
|
||||
tree -L 2 /mnt/nas-fam
|
||||
else
|
||||
|
||||
@@ -22,32 +22,32 @@ if ! [[ -d "$trg_ssh_dir" ]]; then
|
||||
mkdir -p ${trg_ssh_dir}
|
||||
fi
|
||||
|
||||
if ! [[ -f ${trg_ssh_dir}/id_rsa.pub ]]; then
|
||||
if ! [[ -f ${trg_ssh_dir}/*.pub ]]; then
|
||||
echo "deploy id_rsa.pub"
|
||||
cp ${src_ssh_dir}/id_rsa.pub ${trg_ssh_dir}
|
||||
cp ${src_ssh_dir}/*.pub ${trg_ssh_dir}
|
||||
else
|
||||
echo "id_rsa.pub already exist in ${trg_ssh_dir}"
|
||||
fi
|
||||
|
||||
if ! [[ -f ${trg_ssh_dir}/id_rsa.gpg ]]; then
|
||||
echo "deploy id_rsa.gpg"
|
||||
cp ${src_ssh_dir}/id_rsa.gpg ${trg_ssh_dir}
|
||||
else
|
||||
echo "id_rsa.gpg already exist in ${trg_ssh_dir}"
|
||||
fi
|
||||
|
||||
echo "do you want to decrypt id_rsa.gpg? (y/n)"
|
||||
read user_input
|
||||
|
||||
if [[ ${user_input} == "y" ]]; then
|
||||
echo "yes"
|
||||
echo "please, remember the hint: poq.l2"
|
||||
gpg -d ${trg_ssh_dir}/id_rsa.gpg > ${trg_ssh_dir}/id_rsa
|
||||
chmod 0600 ${trg_ssh_dir}/id_rsa # id_rsa can not be accessible by other users
|
||||
else
|
||||
echo "no worries. you can manually decrypt the file, if needed:"
|
||||
echo "gpg -d id_rsa.gpg > id_rsa"
|
||||
echo "*.pub already exist in ${trg_ssh_dir}"
|
||||
fi
|
||||
|
||||
# if ! [[ -f ${trg_ssh_dir}/id_rsa.gpg ]]; then
|
||||
# echo "deploy id_rsa.gpg"
|
||||
# cp ${src_ssh_dir}/id_rsa.gpg ${trg_ssh_dir}
|
||||
# else
|
||||
# echo "id_rsa.gpg already exist in ${trg_ssh_dir}"
|
||||
# fi
|
||||
#
|
||||
# echo "do you want to decrypt id_rsa.gpg? (y/n)"
|
||||
# read user_input
|
||||
#
|
||||
# if [[ ${user_input} == "y" ]]; then
|
||||
# echo "yes"
|
||||
# echo "please, remember the hint: poq.l2"
|
||||
# gpg -d ${trg_ssh_dir}/id_rsa.gpg > ${trg_ssh_dir}/id_rsa
|
||||
# chmod 0600 ${trg_ssh_dir}/id_rsa # id_rsa can not be accessible by other users
|
||||
# else
|
||||
# echo "no worries. you can manually decrypt the file, if needed:"
|
||||
# echo "gpg -d id_rsa.gpg > id_rsa"
|
||||
# fi
|
||||
#
|
||||
echo "${trg_ssh_dir}:"
|
||||
ls -al ${trg_ssh_dir}
|
||||
|
||||
Reference in New Issue
Block a user