post_install() { if [ "$(getent group avahi | cut -d ":" -f 3)" != "84" ]; then groupadd -fg 84 avahi fi if [ "$(getent passwd avahi | cut -d ":" -f 3)" != "84" ]; then useradd -c "Avahi Daemon Owner" -d /run/avahi-daemon -u 84 \ -g avahi -s /bin/false avahi fi if [ "$(getent group netdev | cut -d ":" -f 3)" != "86" ]; then groupadd -fg 86 netdev fi systemctl enable avahi-daemon systemctl enable avahi-dnsconfd } post_upgrade() { post_install } pre_remove() { systemctl stop avahi-daemon systemctl stop avahi-dnsconfd systemctl disable avahi-daemon systemctl disable avahi-dnsconfd } post_remove() { if [[ ! "$(pacman -Qq "networkmanager" 2>/dev/null)" ]];then groupdel netdev 2>/dev/null || true fi groupdel avahi 2>/dev/null || true userdel avahi 2>/dev/null || true }