Support mailcow.conf being a symlink (#3770)

* Support mailcow.conf being a symlink

* Detect BusyBox sed in update.sh
This commit is contained in:
Maxim Baz
2020-09-20 22:07:37 +02:00
committed by GitHub
parent 8c9970230a
commit 05a5f9e84a
2 changed files with 7 additions and 6 deletions

View File

@@ -181,6 +181,7 @@ fi
if grep --help 2>&1 | head -n 1 | grep -q -i "busybox"; then echo "BusybBox grep detected, please install gnu grep, \"apk add --no-cache --upgrade grep\""; exit 1; fi
if cp --help 2>&1 | head -n 1 | grep -q -i "busybox"; then echo "BusybBox cp detected, please install coreutils, \"apk add --no-cache --upgrade coreutils\""; exit 1; fi
if sed --help 2>&1 | head -n 1 | grep -q -i "busybox"; then echo "BusybBox sed detected, please install gnu sed, \"apk add --no-cache --upgrade sed\""; exit 1; fi
CONFIG_ARRAY=(
"SKIP_LETS_ENCRYPT"
@@ -215,7 +216,7 @@ CONFIG_ARRAY=(
"REDIS_PORT"
)
sed -i '$a\' mailcow.conf
sed -i --follow-symlinks '$a\' mailcow.conf
for option in ${CONFIG_ARRAY[@]}; do
if [[ ${option} == "ADDITIONAL_SAN" ]]; then
if ! grep -q ${option} mailcow.conf; then
@@ -525,7 +526,7 @@ if grep -q 'SYSCTL_IPV6_DISABLED=1' mailcow.conf; then
fi
# Checking for old project name bug
sed -i 's#COMPOSEPROJECT_NAME#COMPOSE_PROJECT_NAME#g' mailcow.conf
sed -i --follow-symlinks 's#COMPOSEPROJECT_NAME#COMPOSE_PROJECT_NAME#g' mailcow.conf
# Fix Rspamd maps
if [ -f data/conf/rspamd/custom/global_from_blacklist.map ]; then