dev-scripts/install-local.sh

61 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# default scripts to use
_script_dir='./scripts/debian10'
if [ -n "$1" ] ; then
_script_dir="./scripts/$1"
if ! [ -d "$_script_dir" ] ; then
echo "Error: script directory not found '$_script_dir'"
exit 1
fi
fi
echo "Using Scripts in: $_script_dir"
# source our config files
for _file in ./config/local/* ; do
. "$_file"
done
# check we have ssh access
[ -z "$ssh" ] && echo "Error: no ssh configuration specified" && exit 5
# update local server
echo "Updating ..":
ssh -T $ssh << EOSSH
apt-get update && apt-get upgrade
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