#!/bin/bash

INITSYS=$(ls -al /proc/1/exe | awk -F' ' '{print $NF}' | awk -F'/' '{print $NF}')

if [ "systemd" == "$INITSYS" ]; then
    systemctl stop avahi-daemon.service &> /dev/null || true
    elif [ "init" == "$INITSYS" ]; then
    /etc/init.d/avahi-daemon stop &> /dev/null || true
fi