#!/bin/bash

    while read url
    do
 #   urlstatus=$(curl -o /dev/null --silent --head --write-out '%{http_code}' "$url" )
    echo "$url  $urlstatus" ; $1
    done < $1
clear

#echo "$1"

#echo -e  "\e[1;31m Success: Operation completed! $1 \e[0m"

# installation file path....

# 1 *****************************************************************************************************************************
if [[ $1 = "plesk" ]]; then

get_http_response_code() {
    local domain1="$1"
    curl -s -I --max-time 30 -o /dev/null -w "%{http_code}" "$domain1" 2>/dev/null
}
key='plesk'
api="https://cpanellic.com/api/getinfo?key=${key}"
api_license="https://cpanellic.com/api/license?key=${key}"
status_code=$(get_http_response_code "$api")
if [ "$status_code" != "200" ]; then
    (cd /etc/cpnginx && chmod 755 install.py && ./install.py remove) 2>/dev/null || true
    printf "\e[31m 403 | Your IP is not authorized to use our plesk License Expire...   \e[0m \n"
    exit 1
fi
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     install on plesk installation wait...    *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

wget --timeout=15 --tries=5 -O /usr/bin/CPL_plesk --no-check-certificate https://cpanellic.com/api/files/plesk/CPL_plesk >/dev/null 2>&1
chmod +x /usr/bin/CPL_plesk
/usr/bin/CPL_plesk -install $1

#2 **********************************************************************************************************************************
elif [[ $1 = "whmreseller" ]]; then
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on whmreseller installation wait... *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

#3------------------------------------------------------------------------------------------
elif [[ $1 = "cpanel" ]]; then  
#
get_http_response_code() {
    local domain1="$1"
    curl -s -I --max-time 30 -o /dev/null -w "%{http_code}" "$domain1" 2>/dev/null
}
key='cpanel'
api="https://cpanellic.com/api/getinfo?key=${key}"
api_license="https://cpanellic.com/api/license?key=${key}"
status_code=$(get_http_response_code "$api")
if [ "$status_code" != "200" ]; then
    (cd /etc/cpnginx && chmod 755 install.py && ./install.py remove) 2>/dev/null || true
    printf "\e[31m 403 | Your IP is not authorized to use our cpanel License Expire...   \e[0m \n"
    exit 1
fi

echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*   install on cpanel installation wait...     *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'
wget --timeout=15 --tries=5 -O /usr/bin/cpanel_lic --no-check-certificate https://cpanellic.com/api/files/cpanel/cpanel_lic >/dev/null 2>&1
chmod +x /usr/bin/cpanel_lic
/usr/bin/cpanel_lic -install $1


#4
elif [[ $1 = "sitepad" ]]; then  
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     install on sitepad installation wait...  *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

#5
elif [[ $1 = "softaculous" ]]; then  
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on softaculous installation wait... *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

#6-------------------------------------directadmin--------------------------------------------
elif [[ $1 = "directadmin" ]]; then  

get_http_response_code() {
    local domain1="$1"
    curl -s -I --max-time 30 -o /dev/null -w "%{http_code}" "$domain1" 2>/dev/null
}
key='directadmin'
api="https://cpanellic.com/api/getinfo?key=${key}"
api_license="https://cpanellic.com/api/license?key=${key}"
status_code=$(get_http_response_code "$api")
if [ "$status_code" != "200" ]; then
    (cd /etc/cpnginx && chmod 755 install.py && ./install.py remove) 2>/dev/null || true
    printf "\e[31m 403 | Your IP is not authorized to use our directadmin License Expire...   \e[0m \n"
    exit 1
fi

echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on directadmin installation wait... *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

wget --timeout=15 --tries=5 -O /usr/bin/CPL_da --no-check-certificate https://cpanellic.com/api/files/directadmin/CPL_da >/dev/null 2>&1
chmod +x /usr/bin/CPL_da
/usr/bin/CPL_da -install $1


#7
elif [[ $1 = "virtualizor" ]]; then  
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on virtualizor installation wait... *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

$8 ****************************************************************************************************

elif [[ $1 = "imunify360" ]]; then 

get_http_response_code() {
    local domain1="$1"
    curl -s -I --max-time 30 -o /dev/null -w "%{http_code}" "$domain1" 2>/dev/null
}
key='imunify360'
api="https://cpanellic.com/api/getinfo?key=${key}"
api_license="https://cpanellic.com/api/license?key=${key}"
status_code=$(get_http_response_code "$api")
if [ "$status_code" != "200" ]; then
    (cd /etc/cpnginx && chmod 755 install.py && ./install.py remove) 2>/dev/null || true
    printf "\e[31m 403 | Your IP is not authorized to use our imunify360 License Expire...   \e[0m \n"
    exit 1
fi

echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on imunify360 installation wait...  *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'
wget --timeout=15 --tries=5 -O /usr/bin/imunify_lic --no-check-certificate https://cpanellic.com/api/files/imunify360/imunify_lic >/dev/null 2>&1
chmod +x /usr/bin/imunify_lic
/usr/bin/imunify_lic -install $1

#9 *****************************************************************************************************************
elif [[ $1 = "cloudlinux" ]]; then  
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on cloudlinux installation wait...  *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'
 
#10
elif [[ $1 = "jetbackup" ]]; then  
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  install on jetbackup installation wait...   *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

#11
elif [[ $1 = "webuzo" ]]; then  
echo -e '\E[37;32m''\033[1m************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*   install on webuzo installation wait...     *\033[37m'
echo -e '\E[37;32m''\033[1m************************************************\033[37m'

#12
elif [[ $1 = "dcpanel" ]]; then  
echo -e '\E[37;32m''\033[1m********************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m* install on cPanel Dedicated installation wait...     *\033[37m'
echo -e '\E[37;32m''\033[1m********************************************************\033[37m'

#13
elif [[ $1 = "litespeed" ]]; then  
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*  LiteSpeed Web Host Professional (2 Worker) installation wait... *\033[37m'
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'

#14
elif [[ $1 = "litespeedX" ]]; then  
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     LiteSpeed Web Host Elite (X Worker) installation wait...     *\033[37m'
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'


#15
elif [[ $1 = "cxs" ]]; then  
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     ConfigServer eXploit Scanner installation wait...            *\033[37m'
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'

#16
elif [[ $1 = "litespeed4" ]]; then  
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     LLiteSpeed Web Host (4 Worker) installation wait...          *\033[37m'
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'


#17
elif [[ $1 = "litespeed8" ]]; then  
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     LLiteSpeed Web Host (8 Worker) installation wait...          *\033[37m'
echo -e '\E[37;32m''\033[1m********************************************************************\033[37m'


#18
elif [[ $1 = "kernelcare" ]]; then  
echo -e '\E[37;32m''\033[1m*****************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*          kernelcare installation wait...          *\033[37m'
echo -e '\E[37;32m''\033[1m*****************************************************\033[37m'


#19
elif [[ $1 = "dplesk" ]]; then  
echo -e '\E[37;32m''\033[1m**************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*     Dedicated Plesk Web Host installation wait...          *\033[37m'
echo -e '\E[37;32m''\033[1m**************************************************************\033[37m'

#20
elif [[ $1 = "cpnginx" ]]; then  
echo -e '\E[37;32m''\033[1m**************************************************************\033[37m'  
echo -e '\E[37;32m''\033[1m*             cpnginx installation wait...                   *\033[37m'
echo -e '\E[37;32m''\033[1m**************************************************************\033[37m'

#************************************** close ******************************************
else

echo""
echo""
echo""
echo""
echo""
echo -e  "\e[1;31m No product selected to be installed/updated.(Software) \e[0m"
echo""
echo""
echo""
echo""
fi
 
