#!/bin/bash
#Nifty: Install CloudLinux on CentOS / AlmaLinux.

read -p "Enter Zitcom CloudLinux Install Key: "  key

if [ -z "${key}" ]; then
    echo "Key can't be empty"
    exit 1
fi

###
dnf module enable satellite-5-client
dnf clean all
dnf makecache
dnf update -y || exit 1

cd /tmp
wget http://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
bash cldeploy -k $key
dnf config-manager --disable cloudlinux-rollout*
reboot
