maketank-scripts from ansible

This commit is contained in:
2025-08-25 10:40:17 +02:00
parent 8ec81febba
commit 30ce409c4e
15 changed files with 281 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
SWIFT="swift -A http://kvm01.int.lan:7480/auth/v2.0 -U mx:spam -K o99CuKcfmj31i2UumqB3h8Fh1K0T2bFBO2snbYpk"
BDIR="/var/spool/vmail_imapsieve_copy"
#run only if there is stuff in the dir
SIZE=$(du -sb ${BDIR} |cut -f1)
[[ ${SIZE} -lt 12289 ]] && exit 0
cd $BDIR
remove_files () {
if [[ $2 -eq 0 ]]; then
rm -f $1/*
fi
}
#we have data, upload
ls ham/*.eml 1>/dev/null 2>&1
if [[ $? -eq 0 ]]; then
${SWIFT} upload mailing ham
remove_files ham $?
fi
ls spam/*.eml 1>/dev/null 2>&1
if [[ $? -eq 0 ]]; then
${SWIFT} upload mailing spam
remove_files spam $?
fi