grml-hostname: restart avahi-daemon service if present and running
authorMichael Prokop <mika@grml.org>
Fri, 22 Jun 2012 20:41:33 +0000 (22:41 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 22 Jun 2012 20:41:33 +0000 (22:41 +0200)
Quoting http://bts.grml.org/grml/issue1182:

| When booting a machine with the hostname parameter avahi
| exports the grml hostname even though another hostname was specified.

Testing: issue1182
Thanks: Ulrich Dangel for the bugreport

usr_sbin/grml-hostname

index e97c353..b529d17 100755 (executable)
@@ -57,6 +57,10 @@ Configuration of myhostname in /etc/postfix/main.cf has been adjusted as well. D
        fi
      fi
 
+     if [ -x /etc/init.d/avahi-daemon ] && pgrep avahi-daemon >/dev/null ; then
+       /etc/init.d/avahi-daemon restart
+     fi
+
      /etc/init.d/hostname.sh
 
      if [ -z "$NONINTERACTIVE" ] ; then