X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=primary-setup;h=df30f294662019352acd32ac79d9251a7f391b87;hp=cc335d124814c42b80f849c29753b11a11da59ac;hb=32a1673064cfd9eaa165b4ea62fa416f02f3dfd2;hpb=4d0dc703ef2e62cd16ea84f27456f6f50f74baa3 diff --git a/primary-setup b/primary-setup index cc335d1..df30f29 100755 --- a/primary-setup +++ b/primary-setup @@ -18,6 +18,9 @@ fi if [[ $1 ]]; then new_host=$1 + if [[ $new_host == localhost ]]; then + new_host=$HOSTNAME + fi m sed -ri "s/MAIL_HOST=.*/MAIL_HOST=$new_host/" /a/bin/bash_unpublished/source-state source /a/bin/bash_unpublished/source-state fi @@ -44,6 +47,23 @@ else # done fi +if dpkg -s radicale &>/dev/null; then + if [[ $HOSTNAME == "$MAIL_HOST" ]]; then + m sudo systemctl restart radicale + m sudo systemctl enable radicale + if [[ -e /etc/logrotate.d/radicale.disabled ]]; then + m sudo mv /etc/logrotate.d/radicale{.disabled,} + fi + else + m sudo systemctl stop radicale + m sudo systemctl disable radicale + # weekly logrotate tries to restart radicale even if it's a disabled service in flidas. + if [[ -e /etc/logrotate.d/radicale ]]; then + m sudo mv /etc/logrotate.d/radicale{,.disabled} + fi + fi +fi + m /a/exe/mail-setup exit 0 :