#!/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
    systemctl disable --now avahi-daemon.socket
    systemctl disable --now avahi-daemon.service
    echo "=> Se ha deshabilitado avahi ..."
    elif [ "init" == "$INITSYS" ]; then
    /etc/init.d/avahi-daemon stop &> /dev/null || true
fi