move reset-wordpress.sh
This commit is contained in:
parent
c477713d94
commit
f858776a9e
7
reset.sh
7
reset.sh
|
@ -18,11 +18,6 @@ for _file in ./config/$_target/* ; do
|
|||
. "$_file"
|
||||
done
|
||||
|
||||
if [ "$_target" = remote ] && [ -n "$cloudways_user" ] ; then
|
||||
echo "Using Cloudways - nothing to install"
|
||||
exit
|
||||
fi
|
||||
|
||||
# source script files
|
||||
if [ -n "$_target_os" ] ; then
|
||||
_script_dir="./scripts/$_target_os"
|
||||
|
@ -42,6 +37,6 @@ if [ -n "$wp_user" ] ; then
|
|||
echo "IMPORTANT - we need a confirmation prompt here"
|
||||
echo "You are about to reinstall the $_target WordPress installation"
|
||||
echo "Reinstall WordPress (y/N): "
|
||||
. "$_script_dir/reset-wordpress.sh"
|
||||
. "./scripts/reset-wordpress.sh"
|
||||
. "$_script_dir/install-wordpress.sh"
|
||||
fi
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue