move reset-wordpress.sh

This commit is contained in:
Ray Elliott 2020-09-08 17:35:16 +01:00
parent c477713d94
commit f858776a9e
3 changed files with 16 additions and 6 deletions

View File

@ -18,11 +18,6 @@ for _file in ./config/$_target/* ; do
. "$_file" . "$_file"
done done
if [ "$_target" = remote ] && [ -n "$cloudways_user" ] ; then
echo "Using Cloudways - nothing to install"
exit
fi
# source script files # source script files
if [ -n "$_target_os" ] ; then if [ -n "$_target_os" ] ; then
_script_dir="./scripts/$_target_os" _script_dir="./scripts/$_target_os"
@ -42,6 +37,6 @@ if [ -n "$wp_user" ] ; then
echo "IMPORTANT - we need a confirmation prompt here" echo "IMPORTANT - we need a confirmation prompt here"
echo "You are about to reinstall the $_target WordPress installation" echo "You are about to reinstall the $_target WordPress installation"
echo "Reinstall WordPress (y/N): " echo "Reinstall WordPress (y/N): "
. "$_script_dir/reset-wordpress.sh" . "./scripts/reset-wordpress.sh"
. "$_script_dir/install-wordpress.sh" . "$_script_dir/install-wordpress.sh"
fi fi

0
scripts/debian10/reset-wordpress.sh Executable file → Normal file
View File

15
scripts/reset-wordpress.sh Executable file
View File

@ -0,0 +1,15 @@
echo "Removing WordPress .."
_mysql_cmd="mysql -uroot -p$db_root_pass -e "
ssh -T $ssh << EOSSH
# remove database
if command -v mysql ; then
$_mysql_cmd "DROP DATABASE $wp_db_name;"
else
echo "ERROR: no installed database found - aborting WordPress removal"
exit 40
fi
# remove files
rm -Rf $wp_path
EOSSH