1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

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.
This commit is contained in:
Alberto Bertogli
2016-09-18 06:07:59 +01:00
parent f375f276af
commit e9d62e0467
3 changed files with 17 additions and 7 deletions

View File

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