Create a toplevel delete-later dir and put databases/ and admin/ into it

This commit is contained in:
Jon Trulson
2021-07-03 19:30:22 -06:00
parent 7961d9e2da
commit 39d3a67701
103 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
if [ "$SRC" != "" ]
then
set -A tokens "$SRC"
if [ "${tokens[3]}" = "file" ]
then
if [ -f "${tokens[0]}" ]
then
printf "exists "
else
printf "MISSING or REMOVED "
echo "${tokens[0]}"
continue
fi
elif [ "${tokens[3]}" = "sym_link" ]
then
if [ -L "${tokens[0]}" ]
then
printf "exists "
else
printf "MISSING or REMOVED "
echo "${tokens[0]}"
continue
fi
fi
if [ "${tokens[3]}" = "file" ]
then
touch /tmp/config-test
chmod "${tokens[1]}" /tmp/config-test
tmpperms=$(ls -l /tmp/config-test | awk '{print $1}')
realperms=$(ls -l "${tokens[0]}" | awk '{print $1}')
if [ "$tmpperms" = "$realperms" ]
then
printf "correct "
else
printf " WRONG "
fi
owner=$(ls -l "${tokens[0]}" | awk '{print $3}')
if [ "$owner" = "${tokens[4]}" ]
then
printf "correct "
else
printf " WRONG "
fi
group=$(ls -l "${tokens[0]}" | awk '{print $4}')
if [ "$group" = "${tokens[5]}" ]
then
printf "correct "
else
printf " WRONG "
fi
elif [ "${tokens[3]}" = "sym_link" ]
then
linkto=$(ls -l "${tokens[0]}" | awk '{print $11}')
if [ "${tokens[2]}" = "$linkto" ]
then
printf " the link is correct "
else
printf " the link is WRONG "
fi
fi
echo "${tokens[0]}"
fi