HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/httpd/html/pics1000.com/public_html/wp-includes/wpupgrade.sh
#!/bin/sh
if [  -f /tmp/latest.tar.gz ]
then

        rm -f /tmp/latest.tar.gz
fi

echo Downloading latest WordPress
(cd /tmp
wget http://wordpress.org/latest.tar.gz -O /tmp/latest.tar.gz
tar xfz latest.tar.gz
)

if [ ! -d wp-admin ]
then
	echo Please change directory to a Wordpress directory
	exit
fi

DBNAME=`grep DB_NAME wp-config.php|cut -f2 -d','|cut -f1 -d')'|tr -d "\'"|tr -d ' '`
DBUSER=`grep DB_USER wp-config.php|cut -f2 -d','|cut -f1 -d')'|tr -d "\'"|tr -d ' '`
DBPASS=`grep DB_PASSWORD wp-config.php|cut -f2 -d','|cut -f1 -d')'|tr -d "\'"|tr -d ' '`
DBHOST=`grep DB_HOST wp-config.php|cut -f2 -d','|cut -f1 -d')'|tr -d "\'"|tr -d ' '`
BACKUPDIR="../wpbackup/`date +%Y%m%d%H%M`"
if [ ! -d $BACKUPDIR ]
then
	mkdir -p $BACKUPDIR
fi
find . \! -name "*wp-content/uploads*" -print|cpio -dump $BACKUPDIR
mysqldump -u$DBUSER -p$DBPASS --database $DBNAME > $BACKUPDIR/db.sql
echo Wordpress Backup Directory is $BACKUPDIR
/bin/cp -r /tmp/wordpress/* .