From e67dc79197e5baf68b758b7bf9e7522a1b63381b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 14 May 2020 01:47:34 +0200 Subject: [PATCH] Add the damn short hostname to /etc/hosts automagically --- data/hooks/conf_regen/43-dnsmasq | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/hooks/conf_regen/43-dnsmasq b/data/hooks/conf_regen/43-dnsmasq index 8a2985f34..c28d65288 100755 --- a/data/hooks/conf_regen/43-dnsmasq +++ b/data/hooks/conf_regen/43-dnsmasq @@ -64,6 +64,11 @@ do_post_regen() { systemctl restart resolvconf fi + # Some stupid things like rabbitmq-server used by onlyoffice won't work if + # the *short* hostname doesn't exists in /etc/hosts -_- + short_hostname=$(hostname -s) + grep -q "127.0.0.1.*$short_hostname" /etc/hosts || echo -e "127.0.0.1\t$short_hostname" >>/etc/hosts + [[ -z "$regen_conf_files" ]] \ || service dnsmasq restart }