diff --git a/reset.sh b/reset.sh index 8e0fddb..9dcc984 100755 --- a/reset.sh +++ b/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 diff --git a/scripts/debian10/reset-wordpress.sh b/scripts/debian10/reset-wordpress.sh old mode 100755 new mode 100644 diff --git a/scripts/reset-wordpress.sh b/scripts/reset-wordpress.sh new file mode 100755 index 0000000..547975f --- /dev/null +++ b/scripts/reset-wordpress.sh @@ -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