Removes debug log and adds safety check whether config exists.

This commit is contained in:
damencho 2019-04-05 18:26:25 +01:00 committed by Saúl Ibarra Corretgé
parent 17627291e8
commit 69a12395d2
1 changed files with 5 additions and 5 deletions

View File

@ -126,16 +126,16 @@ case "$1" in
fi fi
PR11_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.11' 2>/dev/null | awk '{print $3}' || true)" PR11_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.11' 2>/dev/null | awk '{print $3}' || true)"
echo "PR11_INSTALL_CHECK is $PR11_INSTALL_CHECK"
PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody 2>/dev/null || true) PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody 2>/dev/null || true)
echo "PR_VER_INSTALLED is $PR_VER_INSTALLED"
if [ "$PR11_INSTALL_CHECK" = "installed" ] \ if [ "$PR11_INSTALL_CHECK" = "installed" ] \
|| [ "$PR11_INSTALL_CHECK" = "unpacked" ] \ || [ "$PR11_INSTALL_CHECK" = "unpacked" ] \
|| dpkg --compare-versions "$PR_VER_INSTALLED" gt "0.11" ; then || dpkg --compare-versions "$PR_VER_INSTALLED" gt "0.11" ; then
sed -i 's/storage = \"null\"/storage = \"memory\"/g' $PROSODY_HOST_CONFIG if [ -f $PROSODY_HOST_CONFIG ]; then
sed -i 's/storage = \"null\"/storage = \"memory\"/g' $PROSODY_HOST_CONFIG
# trigger a restart # trigger a restart
PROSODY_CONFIG_PRESENT="false" PROSODY_CONFIG_PRESENT="false"
fi
fi fi
if [ ! -f /var/lib/prosody/$JICOFO_AUTH_DOMAIN.crt ]; then if [ ! -f /var/lib/prosody/$JICOFO_AUTH_DOMAIN.crt ]; then