Compare commits
No commits in common. "c477713d9476525f3d4a971a68996eb8df670e0e" and "fad8de9d4ecd5b5b6234c813c5502ca6b96e9b31" have entirely different histories.
c477713d94
...
fad8de9d4e
|
@ -7,4 +7,4 @@ Development environment base packages:
|
|||
|
||||
## TODO
|
||||
|
||||
* make sure to use export in all config files (the newer ones aren't)
|
||||
* get remote working with cloudways
|
||||
|
|
47
reset.sh
47
reset.sh
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
_target="$1"
|
||||
_target_os="$2"
|
||||
# default scripts to use
|
||||
_script_dir='./scripts/debian10'
|
||||
|
||||
if ! [ "$_target" = local ] && ! [ "$_target" = remote ] ; then
|
||||
echo "Error: must specify 'local' or 'remote' target"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Loading $_target configuration"
|
||||
|
||||
# source our config files
|
||||
for _file in ./config/$_target/* ; do
|
||||
[ -e "$_file" ] || continue
|
||||
. "$_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"
|
||||
if ! [ -d "$_script_dir" ] ; then
|
||||
echo "Error: script directory not found '$_script_dir'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Using Scripts in: $_script_dir"
|
||||
|
||||
# check we have ssh access
|
||||
[ -z "$ssh" ] && echo "Error: no ssh configuration specified" && exit 5
|
||||
|
||||
if [ -n "$wp_user" ] ; then
|
||||
# TODO - confirmation prompt
|
||||
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"
|
||||
. "$_script_dir/install-wordpress.sh"
|
||||
fi
|
|
@ -21,7 +21,7 @@ else
|
|||
$_mysql_cmd "GRANT ALL PRIVILEGES ON $wp_db_name.* TO '$wp_db_user'@'localhost' IDENTIFIED BY '$wp_db_pass';"
|
||||
$_mysql_cmd "FLUSH PRIVILEGES;"
|
||||
else
|
||||
echo "ERROR: mysql not found - aborting WordPress install"
|
||||
echo "ERROR: no installed database found - aborting WordPress install"
|
||||
exit 40
|
||||
fi
|
||||
wp core download \
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
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