dev-scripts/dev-production-universal/scripts/reset-wordpress.sh

22 lines
472 B
Bash
Raw Normal View History

2020-09-08 20:01:00 +00:00
#!/bin/sh
2020-09-08 16:35:16 +00:00
echo "Removing WordPress .."
# check we have ssh access
[ -z "$ssh_user" ] && echo "Error: no user ssh configuration specified" && exit 5
2020-09-08 16:35:16 +00:00
_mysql_cmd="mysql -u$db_user -p$db_pass -e "
ssh -T $ssh_user << EOSSH
2020-09-08 16:35:16 +00:00
# remove database
if command -v mysql ; then
2020-09-08 17:24:06 +00:00
$_mysql_cmd "DROP DATABASE $db_name;"
$_mysql_cmd "CREATE DATABASE $db_name;"
2020-09-08 16:35:16 +00:00
else
echo "ERROR: mysql not found - aborting WordPress removal"
2020-09-08 16:35:16 +00:00
exit 40
fi
# remove files
rm -Rf $wp_path
EOSSH