Update INSTALL.sh

This commit is contained in:
Stefan Pejcic 2024-08-22 23:05:06 +02:00 committed by GitHub
parent 5f93ecddb8
commit 6d429b9ef7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -668,7 +668,6 @@ clean_apt_and_dnf_cache(){
tweak_ssh(){ tweak_ssh(){
echo "Tweaking SSH service.." echo "Tweaking SSH service.."
echo ""
sed -i "s/[#]LoginGraceTime [[:digit:]]m/LoginGraceTime 1m/g" /etc/ssh/sshd_config sed -i "s/[#]LoginGraceTime [[:digit:]]m/LoginGraceTime 1m/g" /etc/ssh/sshd_config
@ -705,8 +704,7 @@ setup_firewall_service() {
echo "Setting up the firewall.." echo "Setting up the firewall.."
if [ "$CSF_SETUP" = true ]; then if [ "$CSF_SETUP" = true ]; then
echo "Setting up ConfigServer Firewall.." echo "Installing ConfigServer Firewall.."
read_email_address() { read_email_address() {
email=$(grep -E "^e-mail=" /etc/openpanel/openpanel/conf/openpanel.config | cut -d "=" -f2) email=$(grep -E "^e-mail=" /etc/openpanel/openpanel/conf/openpanel.config | cut -d "=" -f2)
@ -722,8 +720,6 @@ setup_firewall_service() {
cd .. cd ..
rm -rf csf rm -rf csf
#perl /usr/local/csf/bin/csftest.pl #perl /usr/local/csf/bin/csftest.pl
echo "Setting CSF auto-login from OpenAdmin interface.." echo "Setting CSF auto-login from OpenAdmin interface.."
if [ "$PACKAGE_MANAGER" == "dnf" ]; then if [ "$PACKAGE_MANAGER" == "dnf" ]; then
debug_log dnf install -y wget curl unzip yum-utils policycoreutils-python-utils debug_log dnf install -y wget curl unzip yum-utils policycoreutils-python-utils
@ -807,6 +803,13 @@ setup_firewall_service() {
fi fi
} }
function extract_port_from_file() {
local file_path=$1
local pattern=$2
local port=$(grep -Po "(?<=${pattern}[ =])\d+" "$file_path")
echo "$port"
}
read_email_address read_email_address
install_csf install_csf
@ -823,7 +826,8 @@ setup_firewall_service() {
open_port_csf 32768:60999 #docker open_port_csf 32768:60999 #docker
set_csf_email_address set_csf_email_address
csf -r csf -r > /dev/null 2>&1
echo "Restarting CSF service"
systemctl restart docker systemctl restart docker
systemctl enable csf systemctl enable csf
service csf start service csf start