2021-08-10 17:53:21 +02:00
|
|
|
#!/usr/bin/env bash
|
2021-08-12 17:28:37 +02:00
|
|
|
echo Removing old sample files…
|
2021-08-16 21:15:27 +02:00
|
|
|
rm /mailautoconf/config/*.sample.yaml
|
2021-08-12 17:28:37 +02:00
|
|
|
|
|
|
|
function write_file() {
|
|
|
|
while read line;
|
|
|
|
do
|
|
|
|
first_char=${line:0:1}
|
2021-08-16 22:10:01 +02:00
|
|
|
first_vers=$(line:0:7)
|
|
|
|
if [[ $first_vers == "Version" ]]; then
|
|
|
|
line="# This is the sample config file for MailAutoConf "$line
|
|
|
|
elif [[ $first_char != "#" ]]; then
|
2021-08-16 21:15:27 +02:00
|
|
|
line="#"$line
|
2021-08-12 17:28:37 +02:00
|
|
|
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"
|
2021-08-12 17:28:37 +02:00
|
|
|
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"
|
2021-08-12 17:28:37 +02:00
|
|
|
write_file $def_serv $new_serv
|
|
|
|
|
2021-08-16 21:15:27 +02:00
|
|
|
echo New sample files copied
|
2021-08-12 17:28:37 +02:00
|
|
|
|
2021-08-16 21:15:27 +02:00
|
|
|
cd /mailautoconf
|
|
|
|
exec /mailautoconf/mailautoconf
|