dev-scripts/install-local.sh

59 lines
1.2 KiB
Bash
Raw Normal View History

2020-09-03 13:46:19 +00:00
#!/bin/sh
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
if [ -n "$1" ] ; then
2020-09-04 14:04:28 +00:00
_script_dir="./scripts/$1"
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 19:40:25 +00:00
# source our config files
2020-09-03 13:46:19 +00:00
for _file in ./config/local/* ; do
. "$_file"
done
# check we have ssh access
[ -z "$ssh" ] && echo "Error: no ssh configuration specified" && exit 5
2020-09-03 19:40:25 +00:00
# update local server
2020-09-03 13:46:19 +00:00
echo "Updating ..":
ssh -T $ssh << EOSSH
apt-get update && apt-get upgrade
EOSSH
echo "Update complete"
2020-09-04 13:49:07 +00:00
. "$_script_dir/install-user.sh"
. "$_script_dir/install-base.sh"
2020-09-03 19:40:25 +00:00
if [ -n "$php_version" ] ; then
2020-09-04 13:49:07 +00:00
. "$_script_dir/install-php.sh"
2020-09-03 19:40:25 +00:00
fi
if [ -n "$mariadb_version" ] ; then
2020-09-04 13:49:07 +00:00
. "$_script_dir/install-mariadb.sh"
2020-09-03 19:40:25 +00:00
elif [ -n "$mysql_version" ] ; then
2020-09-04 13:49:07 +00:00
. "$_script_dir/install-mysql.sh"
2020-09-03 19:40:25 +00:00
fi
if [ -n "$apache2_version" ] ; then
2020-09-04 13:49:07 +00:00
. "$_script_dir/install-apache2.sh"
2020-09-03 19:40:25 +00:00
elif [ -n "$nginx_version" ] ; then
# TODO nginx install script
2020-09-04 13:49:07 +00:00
echo 'TODO - nginx install script'
2020-09-03 19:40:25 +00:00
elif [ -n "$litespeed_version" ] ; then
# TODO
2020-09-04 13:49:07 +00:00
echo 'TODO litespeed install script'
2020-09-03 19:40:25 +00:00
fi
2020-09-03 13:46:19 +00:00
2020-09-04 13:25:23 +00:00
if [ -n "$wp_user" ] ; then
2020-09-04 13:49:07 +00:00
. "$_script_dir/install-wordpress.sh"
2020-09-04 13:25:23 +00:00
fi
2020-09-03 19:40:25 +00:00
2020-09-04 13:25:23 +00:00
# TODO source dev env script