Shadow-Here


Server : Apache
System : Linux methusalix2 3.16.0-11-amd64 #1 SMP Debian 3.16.84-1 (2020-06-09) x86_64
User : hios ( 1437)
PHP Version : 5.6.40-0+deb8u12
Disable Function : proc_close,proc_open,dl,shell_exec,passthru
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :
Current File : //usr/local/bin/apx-phpmyadmin
#!/bin/bash
logger "starting $0"

# source definitions
if [ -f /etc/apx-phpmyadmin/apx-phpmyadmin.conf ]; then
	source /etc/apx-phpmyadmin/apx-phpmyadmin.conf
else
	echo "/etc/apx-phpmyadmin/apx-phpmyadmin.conf MISSING. ABORT!"
	exit 1
fi

if [ -f /etc/apx-phpmyadmin/apx-phpmyadmin.local.conf ]; then
	source /etc/apx-phpmyadmin/apx-phpmyadmin.local.conf
	logger "$0 sourcing config"
else
	logger "$0 no local.conf"
fi

# create folder
mkdir -p $path/$folder

# backup config
if [ -f $path/$folder/config.inc.php ]; then
    cp -p $path/$folder/config.inc.php /etc/apx-phpmyadmin/config.inc.php
fi




# change to installation path
if ( ! cd $path ); then
	echo "cannot change to $path"
	echo "this location is mandatory! Abort"
	logger "$0 this location is mandatory! Abort"
	exit 1
fi
cd $path

# make it worldreadable
if [ -d ./$folder ]; then
	chmod -R +r ./$folder
fi


# secure the scripts folder
if [ -d $path/$folder/scripts ]; then
	chmod 0 $path/$folder/scripts
fi

# make symlink if not exists
if [ ! -h $path/current ]; then
    ln -s $path/$folder $path/current
    logger "$0 created symlink"
fi
# send notify emails
if ( $NOTIFY ); then
	echo "phpMyAdmin was updated" | mail -s "`hostname` phpMyAdmin update" $NOTIFY_WHO
	logger "send notify email: phpMyAdmin was updated"
fi

Samx