2020-09-03 13:46:19 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-09-05 10:10:14 +00:00
|
|
|
_target="$1"
|
|
|
|
_target_os="$2"
|
2020-09-04 13:49:07 +00:00
|
|
|
# default scripts to use
|
2020-09-04 14:04:28 +00:00
|
|
|
_script_dir='./scripts/debian10'
|
2020-09-04 13:49:07 +00:00
|
|
|
|
2020-09-05 10:10:14 +00:00
|
|
|
if ! [ "$_target" = local ] && ! [ "$_target" = remote ] ; then
|
|
|
|
echo "Error: must specify 'local' or 'remote' target"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-09-05 11:01:33 +00:00
|
|
|
|
2020-09-05 10:46:59 +00:00
|
|
|
echo "Loading $_target configuration"
|
2020-09-05 10:10:14 +00:00
|
|
|
|
|
|
|
# source our config files
|
2020-09-05 10:46:59 +00:00
|
|
|
for _file in ./config/$_target/* ; do
|
|
|
|
[ -e "$_file" ] || continue
|
2020-09-05 10:10:14 +00:00
|
|
|
. "$_file"
|
|
|
|
done
|
|
|
|
|
2020-09-05 11:01:33 +00:00
|
|
|
# source script files
|
2020-09-05 10:10:14 +00:00
|
|
|
if [ -n "$_target_os" ] ; then
|
|
|
|
_script_dir="./scripts/$_target_os"
|
2020-09-04 13:49:07 +00:00
|
|
|
if ! [ -d "$_script_dir" ] ; then
|
|
|
|
echo "Error: script directory not found '$_script_dir'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using Scripts in: $_script_dir"
|
|
|
|
|
2020-09-03 13:46:19 +00:00
|
|
|
# check we have ssh access
|
2020-09-08 17:59:02 +00:00
|
|
|
[ -z "$ssh_root" ] && echo "Error: no root ssh configuration specified" && exit 5
|
2020-09-03 13:46:19 +00:00
|
|
|
|
2020-09-05 10:10:14 +00:00
|
|
|
# update
|
2020-09-04 20:45:04 +00:00
|
|
|
echo "Updating .."
|
2020-09-08 17:59:02 +00:00
|
|
|
ssh -T $ssh_root << EOSSH
|
2020-09-04 20:52:31 +00:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2020-09-04 21:24:19 +00:00
|
|
|
apt-get -qq -y update && apt-get -qq -y upgrade
|
2020-09-03 13:46:19 +00:00
|
|
|
EOSSH
|
|
|
|
echo "Update complete"
|
|
|
|
|
2020-09-04 13:49:07 +00:00
|
|
|
. "$_script_dir/install-user.sh"
|
2020-09-05 10:46:59 +00:00
|
|
|
# . "$_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
|