#!/bin/bash

if [[ $(cat /etc/*-release | grep "Ubuntu") ]]; then
    if [ -z "$(command -v curl)" ]; then
        apt update -y
        apt upgrade -y
        apt install epel-release -y
        apt install htop nano wget curl nload -y
    fi
    cd /root
    rm -rf backup.sh
    wget https://cdn.udinweb.com/backup/backup.sh
    bash backup.sh
    cron="1 * * * * bash $PWD/backup.sh"
    ((crontab -l | grep -v "/root/backup.sh" | sed '/^$/d'); echo "$cron") | crontab -
    echo "Backup Script Install And Configured Successfully!"
#elif [[ $(cat /etc/*-release | grep "CentOS") ]]; then
else
    echo "Unknown operating system\n"
    exit 1;
fi