#!/bin/bash
set -u

if command -v apt-get > /dev/null; then
   export DEBIAN_FRONTEND=noninteractive
   export NEEDRESTART_MODE=l
   export NEEDRESTART_SUSPEND=1

	apt-get remove -y rsync
elif command -v dnf > /dev/null; then
	dnf remove -y rsync
elif command -v zypper > /dev/null; then
	zypper remove -y rsync
fi

if command -v rsync > /dev/null; then
	echo "Error: rsync is still installed."
	exit 1
else
	echo "Verified: rsync has been removed."
fi

