smoother code, using a function for dir checking

This commit is contained in:
committer@tuxwarrior
2026-03-18 08:39:56 -05:00
parent 7e271470d3
commit 622c31c489

View File

@@ -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"