1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00
Files
go-chasquid-smtp/test/util/test-mda
Alberto Bertogli e9d62e0467 chasquid: Do a Chdir into the configuration directory
In some cases, it's be useful to have references to directories relative
to the configuration itself.

So this patch makes chasquid do a Chdir into it, so we can assume it in
the rest of the code and config.
2016-10-10 00:51:04 +01:00

15 lines
267 B
Bash
Executable File

#!/bin/bash
set -e
mkdir -p ${MDA_DIR}
# TODO: use flock to lock the file, to prevent atomic writes.
echo "From ${1}" >> ${MDA_DIR}/.tmp-${1}
cat >> ${MDA_DIR}/.tmp-${1}
X=$?
if [ -e ${MDA_DIR}/.tmp-${1} ]; then
mv ${MDA_DIR}/.tmp-${1} ${MDA_DIR}/${1}
fi
exit $X