403Webshell
Server IP : 199.250.200.62  /  Your IP : 216.73.217.89
Web Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /opt/dedrads/provision/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/dedrads/provision/cpanel
#!/bin/bash
set -euo pipefail;

RED='\033[0;31m';
GREEN='\033[1;32m';
NC='\033[0m';

function catch_exit()
{
    rc=$?
    if [ $rc -ne 0 ]; then
        echo -e "${RED}ERROR: Script hit an error and has halted with exit code $rc. Please review /root/cpanel_setup.log${NC}";
    else
        echo -e "${GREEN}Script finished successfully.${NC}";
    fi
    exit $rc;
}
license_check()
{
    lic_check=$(curl -s "https://verify.cpanel.net/api/ipaddrs");
    cur_license=$(echo "${lic_check}" | jq -r '.current');
    ipaddr=$(echo "${lic_check}" | jq -r '.ip');

    if [ -z "${cur_license}" ] || [ "${cur_license}" == "null" ]; then
        echo -e "License check: ${RED}FAIL - Server is unlicensed. Please license ${ipaddr}${NC}";
        exit 1;
    else
        echo -e "License check: ${GREEN}OK${NC}";
    fi
}

install_cpanel()
{
    # Prep Install cPanel
    /usr/bin/wget -O /home/latest https://securedownloads.cpanel.net/latest;

    # Cpanel Install auto logs to /var/log/cpanel-install.log the rest to /root/cpanel-setup.log
    /usr/bin/sh /home/latest;

    # Check if cPanel install is OK
    if [ ! -e /usr/local/cpanel/version ]; then
        echo -e "${RED}ERROR: cPanel Install Failed${NC}";
        exit 1;
    fi
}

main_script()
{
    trap catch_exit SIGINT;
    trap catch_exit EXIT;
    echo "New cPanel Provision Beginning: $(date)";
    license_check;
    install_cpanel;
}

if [ $# -eq 1 ]; then
    echo "/opt/dedrads/provision/cpanel";
    echo; echo "Run without any args to do full installation process.";
else
    main_script | tee -a /root/cpanel_setup.log
fi

Youez - 2016 - github.com/yon3zu
LinuXploit