load configuration based on target

This commit is contained in:
Ray Elliott 2020-09-05 11:46:59 +01:00
parent b624a6e8cb
commit 40f17c5a8e
1 changed files with 35 additions and 30 deletions

View File

@ -9,9 +9,12 @@ 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/local/* ; do
for _file in ./config/$_target/* ; do
[ -e "$_file" ] || continue
echo " reading config: $_file"
. "$_file"
done
@ -28,6 +31,8 @@ echo "Using Scripts in: $_script_dir"
# check we have ssh access
[ -z "$ssh" ] && echo "Error: no ssh configuration specified" && exit 5
exit
# update
echo "Updating .."
ssh -T $ssh << EOSSH
@ -37,32 +42,32 @@ EOSSH
echo "Update complete"
. "$_script_dir/install-user.sh"
. "$_script_dir/install-base.sh"
if [ -n "$php_version" ] ; then
. "$_script_dir/install-php.sh"
fi
if [ -n "$mariadb_version" ] ; then
. "$_script_dir/install-mariadb.sh"
elif [ -n "$mysql_version" ] ; then
. "$_script_dir/install-mysql.sh"
fi
if [ -n "$apache2_version" ] ; then
. "$_script_dir/install-apache2.sh"
elif [ -n "$nginx_version" ] ; then
# TODO nginx install script
echo 'TODO - nginx install script'
elif [ -n "$litespeed_version" ] ; then
# TODO
echo 'TODO litespeed install script'
fi
if [ -n "$wp_user" ] ; then
. "$_script_dir/install-wordpress.sh"
fi
if [ -n "$dev_env" ] ; then
. "$_script_dir/install-dev-base.sh"
fi
# . "$_script_dir/install-base.sh"
#
# if [ -n "$php_version" ] ; then
# . "$_script_dir/install-php.sh"
# fi
#
# if [ -n "$mariadb_version" ] ; then
# . "$_script_dir/install-mariadb.sh"
# elif [ -n "$mysql_version" ] ; then
# . "$_script_dir/install-mysql.sh"
# fi
#
# if [ -n "$apache2_version" ] ; then
# . "$_script_dir/install-apache2.sh"
# elif [ -n "$nginx_version" ] ; then
# # TODO nginx install script
# echo 'TODO - nginx install script'
# elif [ -n "$litespeed_version" ] ; then
# # TODO
# echo 'TODO litespeed install script'
# fi
#
# if [ -n "$wp_user" ] ; then
# . "$_script_dir/install-wordpress.sh"
# fi
#
# if [ -n "$dev_env" ] ; then
# . "$_script_dir/install-dev-base.sh"
# fi