#!/bin/bash

set -e

RED='\e[1;31m'

if [[ "$EUID" -ne "0" ]]; then
        echo -e $RED "Run this script as root or with the sudo command to continue."
        exit 1
fi

systemctl disable --now 2ping || true
systemctl disable --now arpalert || true
systemctl disable --now arpwatch || true
systemctl disable --now avahi-daemon.socket || true
systemctl disable --now avahi-daemon.service || true
systemctl disable --now bacula-fd || true
systemctl disable --now bacula-sd || true
systemctl disable --now bettercap || true
systemctl disable --now bluetooth || true
systemctl disable --now btrbk.service || true
systemctl disable --now btrbk.timer || true
systemctl disable --now btrfs-balance.service || true
systemctl disable --now btrfs-balance.timer || true
systemctl disable --now btrfs-defrag.service || true
systemctl disable --now btrfs-defrag.timer || true
systemctl disable --now btrfsmaintenance-refresh.path || true
systemctl disable --now btrfsmaintenance-refresh.service || true
systemctl disable --now btrfs-scrub.service || true
systemctl disable --now btrfs-scrub.timer || true
systemctl disable --now btrfs-trim.service || true
systemctl disable --now btrfs-trim.timer || true
systemctl disable --now chrony || true
systemctl disable --now clamav-daemon.socket || true
systemctl disable --now clamav-daemon.service || true
systemctl disable --now clamav-freshclam || true
systemctl disable --now clamav-milter || true
systemctl disable --now containerd || true
systemctl disable --now cups-browsed || true
systemctl disable --now cups.path || true
systemctl disable --now cups.socket || true
systemctl disable --now cups.service || true
systemctl disable --now darkstat || true
systemctl disable --now docker.socket || true
systemctl disable --now docker.service || true
systemctl disable --now e2scrub_all.timer || true
systemctl disable --now e2scrub_reap || true
systemctl disable --now etc-setserial || true
systemctl disable --now fio || true
systemctl disable --now firewalld || true
systemctl disable --now gns3-server || true
systemctl disable --now ip6tables || true
systemctl disable --now iptables || true
systemctl disable --now libvirtd-admin.socket || true
systemctl disable --now libvirtd-ro.socket || true
systemctl disable --now libvirtd.socket || true
systemctl disable --now libvirtd.service || true
systemctl disable --now libvirtd-tcp.socket || true
systemctl disable --now libvirtd-tls.socket || true
systemctl disable --now libvirt-guests.service || true
systemctl disable --now lm-sensors || true
systemctl disable --now lxcfs || true
systemctl disable --now lxc-monitord.service || true
systemctl disable --now lxc-net || true
systemctl disable --now lxc || true
systemctl disable --now lxd-agent.service || true
systemctl disable --now lxd.socket || true
systemctl disable --now lxd.service || true
systemctl disable --now lxd-containers.service || true
systemctl disable --now neo4j || true
systemctl disable --now netfilter-persistent || true
systemctl disable --now nfs-blkmap.service || true
systemctl disable --now nfs-client.target || true
systemctl disable --now nfs-common.service || true
systemctl disable --now nfsdcld.service || true
systemctl disable --now nfs-idmapd.service || true
systemctl disable --now nfs-kernel-server || true
systemctl disable --now nfs-mountd.service || true
systemctl disable --now nfs-server.service || true
systemctl disable --now nfs-utils.service || true
systemctl disable --now nftables || true
systemctl disable --now nmbd || true
systemctl disable --now o2cb || true
systemctl disable --now ocfs2 || true
systemctl disable --now openbao || true
systemctl disable --now openvpn || true
systemctl disable --now plocate-updatedb.service || true
systemctl disable --now plocate-updatedb.timer || true
systemctl disable --now podman-auto-update.service || true
systemctl disable --now podman-auto-update.timer || true
systemctl disable --now podman-restart.service || true
systemctl disable --now podman.socket || true
systemctl disable --now podman.service || true
systemctl disable --now portmap || true
systemctl disable --now puppet || true
systemctl disable --now pxp-agent || true
systemctl disable --now rpcbind.socket || true
systemctl disable --now rpcbind.service || true
systemctl disable --now rpc-gssd.service || true
systemctl disable --now rpc-statd-notify.service || true
systemctl disable --now rpc-statd.service || true
systemctl disable --now rpc-svcgssd.service || true
systemctl disable --now rsync || true
systemctl disable --now samba-ad-dc.service || true
systemctl disable --now setserial || true
systemctl disable --now smartmontools || true
systemctl disable --now smbd || true
systemctl disable --now snapper-boot.service || true
systemctl disable --now snapper-boot.timer || true
systemctl disable --now snapper-cleanup.service || true
systemctl disable --now snapper-cleanup.timer || true
systemctl disable --now snapperd || true
systemctl disable --now snapper-timeline.service || true
systemctl disable --now snapper-timeline.timer || true
systemctl disable --now ssh.socket || true
systemctl disable --now ssh.service || true
systemctl disable --now sysstat-collect.service || true
systemctl disable --now sysstat-collect.timer || true
systemctl disable --now sysstat || true
systemctl disable --now sysstat-summary.service || true
systemctl disable --now sysstat-summary.timer || true
systemctl disable tftpd-hpa || true
systemctl stop tftpd-hpa || true
systemctl disable --now vault || true
systemctl disable --now virtlockd-admin.socket || true
systemctl disable --now virtlockd.socket || true
systemctl disable --now virtlockd.service || true
systemctl disable --now virtlogd-admin.socket || true
systemctl disable --now virtlogd.socket || true
systemctl disable --now virtlogd.service || true
systemctl disable --now winbind || true
systemctl disable --now zfs-import-cache.service || true
systemctl disable --now zfs-import-scan.service || true
systemctl disable --now zfs-import.target || true
systemctl disable --now zfs-load-module.service || true
systemctl disable --now zfs-mount.service || true
systemctl disable --now zfs-scrub-monthly@.timer || true
systemctl disable --now zfs-scrub-weekly@.timer || true
systemctl disable --now zfs-scrub@.service || true
systemctl disable --now zfs-share.service || true
systemctl disable --now zfs-trim-monthly@.timer || true
systemctl disable --now zfs-trim-weekly@.timer || true
systemctl disable --now zfs-trim@.service || true
systemctl disable --now zfs-volume-wait.service || true
systemctl disable --now zfs-volumes.target || true
systemctl disable --now zfs.target || true
systemctl disable --now zfs-import.service || true
systemctl disable --now zfs-load-key.service || true
systemctl disable --now zfs-zed.service || true
