#!/bin/bash # barebones install script for CWP version=$1 # el7, el8 if [[ -z $version ]]; then echo "Please specify the version, i.e el7" fi if [[ -d /var/nopanel ]]; then echo "Cannot install CWP on a server with NoPanel selected" exit 1 elif [[ -d /var/cpanel ]]; then echo "Cannot install CWP on a server with cPanel already installed" exit 1 fi systemctl disable --now firewalld echo nameserver 1.1.1.1 > /etc/resolv.conf mkdir -p /usr/local/src cd /usr/local/src wget http://centos-webpanel.com/cwp-$version-latest # Update cwp-$version-latest file to include module_hotfixes and # We want 10.6 LTS for MariaDB repo_file=$(cat cwp-$version-latest | grep -nA20 mariadb | grep -m2 -B100 EOF) if ! echo "$repo_file" | grep -q 'module_hotfixes=1'; then sed -i.bak -e $(echo "$repo_file" | grep -- -EOF | grep -Po '^\d+')i' module_hotfixes=1' -e 's/10.5/10.6/g' cwp-$version-latest fi sh cwp-$version-latest --modsecurity yes exit $?