mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
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.
15 lines
267 B
Bash
Executable File
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
|