minor fix
[distro-setup] / mail-setup
index 3efee8bf7f7c7882ffef931ea2d39d9ecd45b3f5..b28bedf004b895d497ccb3c98c2f61f602947fab 100755 (executable)
@@ -168,7 +168,7 @@ smarthost="$mxhost::$mxport"
 
 ## * Install packages
 # light version of exim does not have sasl auth support.
-pi exim4-daemon-heavy spamassassin spf-tools-perl openvpn dnsmasq
+pi exim4-daemon-heavy spamassassin spf-tools-perl openvpn
 
 # trisquel 8 = openvpn, debian stretch = openvpn-client
 vpn_ser=openvpn-client
@@ -624,7 +624,9 @@ EOF
   /a/exe/cedit mail /etc/dnsmasq-servers.conf <<'EOF' || [[ $? == 1 ]]
 server=/mail.iankelling.org/127.0.1.1
 EOF
-  systemctl reload dnsmasq
+  if systemctl is-active dnsmasq >/dev/null; then
+    systemctl reload dnsmasq
+  fi
 
   # I used to use debconf-set-selections + dpkg-reconfigure,
   # which then updates this file
@@ -875,8 +877,11 @@ fi
 
 # * reload exim
 
-systemctl reload exim4
-systemctl start exim4
+if systemctl is-active exim4 >/dev/null; then
+  systemctl reload exim4
+else
+  systemctl start exim4
+fi
 
 
 # * mail monitoring / testing