maildir-last-change.sh: fix error, if domain is given at commandline.
This commit is contained in:
parent
62b6118d66
commit
616cfd8eee
@ -277,6 +277,25 @@ else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
echononl "Remove old statistic files .."
|
||||
if [[ "$DOMAIN" = "*" ]] ; then
|
||||
rm -f ${DST_DIR}/* > $error_log 2>&1
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo_done
|
||||
else
|
||||
echo_failed
|
||||
error "$(cat "$error_log")"
|
||||
fi
|
||||
else
|
||||
rm -f "${DST_DIR}/${DOMAIN}/*"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo_done
|
||||
else
|
||||
echo_failed
|
||||
error "$(cat "$error_log")"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echononl "Determin last change time for mailboxes.."
|
||||
echo_wait
|
||||
@ -311,7 +330,11 @@ echononl "Write down statistic files per domain .."
|
||||
echo_wait
|
||||
_failed=false
|
||||
for _domain in "${_domain_arr[@]}" ; do
|
||||
if [[ ${#_domain_arr[@]} -eq 1 ]] ; then
|
||||
cat $_CACHE_FILE | sort -n > "${DST_DIR}/${_domain}.stat" 2> "$error_log"
|
||||
else
|
||||
cat "${DST_DIR}/00-all-domains.stat" | grep "@$_domain" > "${DST_DIR}/${_domain}.stat" 2> "$error_log"
|
||||
fi
|
||||
if [[ $? -ne 0 ]]; then
|
||||
_failed=true
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user