2020-09-07 11:24:58 +00:00
|
|
|
#!/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
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
|
|
|
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): "
|
2020-09-08 16:35:16 +00:00
|
|
|
. "./scripts/reset-wordpress.sh"
|
2020-09-07 11:24:58 +00:00
|
|
|
. "$_script_dir/install-wordpress.sh"
|
|
|
|
fi
|