diff --git a/dots/bin/importGnupgKeys.sh b/dots/bin/importGnupgKeys.sh index 20d6938..25ff543 100755 --- a/dots/bin/importGnupgKeys.sh +++ b/dots/bin/importGnupgKeys.sh @@ -2,21 +2,23 @@ # klevstul :: 24.06 :: docs: docs/gpg.md +dir_checker() { + dir=$1 + + if [ ! -d ${dir} ]; then + echo "error: missing directory '${dir}'" + exit 1 + fi +} + src_dir=/home/poq/syncDir/secrets/gnupg tmp_dir=/tmp this_file_name=`basename "$0"` echo "$this_file_name" -if [ ! -d ${src_dir} ]; then - echo "error: missing directory '${src_dir}'" - exit 1 -fi - -if [ ! -d ${tmp_dir} ]; then - echo "error: missing directory '${tmp_dir}'" - exit 1 -fi +dir_checker ${src_dir} +dir_checker ${tmp_dir} echo "please, remember the hint: bibL2"