write status file only if parent dir exists

This commit is contained in:
2022-12-16 23:20:36 +01:00
parent 7e9677bd48
commit d991b866b0

View File

@@ -34,5 +34,5 @@ while read uh; do mysql --defaults-file=${defaultfile} -BNe "show grants for $uh
if [ $error -eq 0 ] ; then if [ $error -eq 0 ] ; then
find $rdir -maxdepth 1 -type d -mtime +${rotate} -exec rm -fr {} \; find $rdir -maxdepth 1 -type d -mtime +${rotate} -exec rm -fr {} \;
fi fi
echo $error > $status_file test -d ${status_file%/*} && echo $error > $status_file
exit $error exit $error