mailautoconf/entrypoint.sh

30 lines
682 B
Bash
Raw Normal View History

#!/usr/bin/env bash
echo Removing old sample files…
2021-08-16 21:15:27 +02:00
rm /mailautoconf/config/*.sample.yaml
function write_file() {
while read line;
do
first_char=${line:0:1}
2021-08-16 21:15:27 +02:00
if [[ $first_char != "#" ]]; then
line="#"$line
fi
echo $line >> $2
done < $1
}
echo Setting up new sample config files…
2021-08-16 21:15:27 +02:00
def_conf="/mailautoconf/default-config/config.default.yaml"
new_conf="/mailautoconf/config/config.sample.yaml"
write_file $def_conf $new_conf
2021-08-16 21:15:27 +02:00
def_serv="/mailautoconf/default-config/services.default.yaml"
new_serv="/mailautoconf/config/services.sample.yaml"
write_file $def_serv $new_serv
2021-08-16 21:15:27 +02:00
echo New sample files copied
2021-08-16 21:15:27 +02:00
cd /mailautoconf
exec /mailautoconf/mailautoconf