~ K A L I ~
UNAME : Linux web65.extendcp.co.uk 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64SERVER IP : 10.0.187.65 -________-
CLIENT IP : 216.73.216.230 MINI SHELL D ZAB '
Current File : //usr/share/maxscale/postinst |
#!/bin/sh
# Create directories
mkdir -p /usr/lib64/maxscale
mkdir -p /usr/bin
mkdir -p /usr/share/maxscale
mkdir -p /usr/share/doc/MaxScale/maxscale
# MAXSCALE_VARDIR is an absolute path to /var by default
mkdir -p /var/log/maxscale
mkdir -p /var/lib/maxscale
mkdir -p /var/cache/maxscale
mkdir -p /var/run/maxscale
# Create MaxScale user if it doesnt' exist
if ! getent passwd maxscale > /dev/null
then
groupadd -r maxscale
useradd -r -s /bin/false -g maxscale maxscale
fi
# Change the owner of the directories to maxscale:maxscale
chown -R maxscale:maxscale /var/log/maxscale
chown -R maxscale:maxscale /var/lib/maxscale
chown -R maxscale:maxscale /var/cache/maxscale
chown -R maxscale:maxscale /var/run/maxscale
chmod 0755 /var/log/maxscale
chmod 0755 /var/lib/maxscale
chmod 0755 /var/cache/maxscale
chmod 0755 /var/run/maxscale
# Create the module configuration directory (default: /etc/maxscale.modules.d/)
mkdir -p /etc/maxscale.modules.d
# Install ldconfig files
if [ -f "/usr/share/maxscale/maxscale.conf" ]
then
cp /usr/share/maxscale/maxscale.conf /etc/ld.so.conf.d/
else
echo "Could not find ldconfig file: /usr/share/maxscale/maxscale.conf" >& 2
fi
# Only copy the service files if the systemd folder and systemctl executable are found
if [ -f /usr/share/maxscale/maxscale.service ] && command -v systemctl > /dev/null
then
if [ -d "/lib/systemd/system" ]
then
cp /usr/share/maxscale/maxscale.service /lib/systemd/system
systemctl daemon-reload > /dev/null 2>&1
elif [ -d "/usr/lib/systemd/system" ]
then
cp /usr/share/maxscale/maxscale.service /usr/lib/systemd/system
systemctl daemon-reload > /dev/null 2>&1
fi
# Remove old directories, mistakenly installed by a few versions
if [ -d /lib/systemd/system/maxscale.service.d ]
then
rmdir /lib/systemd/system/maxscale.service.d
elif [ -d /usr/lib/systemd/system/maxscale.service.d ]
then
rmdir /lib/systemd/system/maxscale.service.d
fi
mkdir -p /etc/systemd/system/maxscale.service.d
systemctl enable maxscale.service > /dev/null 2>&1
systemctl is-active maxscale.service --quiet > /dev/null 2&>1 && systemctl restart maxscale.service > /dev/null 2>&1
else
if [ -d "/etc/init/" ] && [ -f "/usr/share/maxscale/upstart/maxscale.conf" ]
then
cp /usr/share/maxscale/upstart/maxscale.conf /etc/init/
fi
# If systemd is not present, use init.d scripts if they're present
if [ -d "/etc/init.d/" ] && [ -f "/usr/share/maxscale/maxscale" ]
then
cp /usr/share/maxscale/maxscale /etc/init.d/
fi
service maxscale status > /dev/null 2>&1 && service maxscale restart > /dev/null
fi
# If no maxscale.cnf file is found in /etc, copy the template file there
if [ ! -f "/etc/maxscale.cnf" ]
then
cp /etc/maxscale.cnf.template /etc/maxscale.cnf
mkdir -p /etc/maxscale.cnf.d/
fi
# If no logrotate config file is found, create one
if [ ! -f "/etc/logrotate.d/maxscale_logrotate" ]
then
cp /usr/share/maxscale/maxscale_logrotate /etc/logrotate.d/maxscale_logrotate
fi
/sbin/ldconfig
Coded by KALI :v Greetz to DR HARD ../ kali.zbi@hotmail.com