dev-scripts/server-install-web.sh

67 lines
1.4 KiB
Bash
Raw Normal View History

2020-06-08 18:59:06 +00:00
#!/bin/sh
2020-06-12 22:41:13 +00:00
. ./config
if [ "$1" = 'local' ] ; then
src_url="$local_url";
dest_url="$remote_url";
src_ssh="$local_ssh"
elif [ "$1" = 'remote' ] ; then
src_url="$remote_url";
dest_url="$local_url";
src_ssh="$remote_ssh"
else
echo "error: must specify local or remote"
exit 5
fi
ssh -T $src_ssh << EOSSH
2020-06-08 22:21:28 +00:00
success="0"
if [ -n "$apache2_version" ] ; then
echo "TODO install apache"
exit 1
elif [ -n "$nginx_version" ] ; then
echo "TODO install nginx"
exit 1
2020-06-13 10:25:25 +00:00
elif [ -n "$litespeed_version" ] ; then
if [ "$litespeed_version" != 'latest' ] ; then
2020-06-08 22:23:01 +00:00
echo "TODO install specific litespeed version"
2020-06-08 22:21:28 +00:00
echo ""
2020-06-13 10:25:25 +00:00
echo "Specify \"litespeed_version='latest'\" to install current version."
2020-06-08 22:21:28 +00:00
exit 1
fi
if [ -n "$wp_user" ] ; then
wget --no-check-certificate https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh && bash ols1clk.sh \
--adminpassword "$ls_webadmin_pass" \
--lsphp "$ls_lsphp_version" \
2020-06-12 22:41:13 +00:00
--wordpressplus "$src_url" \
2020-06-08 22:21:28 +00:00
--wordpresspath "$wp_path" \
--dbrootpassword "$db_root_pass" \
--dbpassword "$wp_db_pass" \
--dbname "$wp_db_name" \
--dbuser "$wp_db_user" \
--wpuser "$wp_user" \
--wppassword "$wp_pass" \
&& success="1" \
&& ufw allow 7080
else
2020-06-13 10:25:25 +00:00
echo "TODO install litespeed without WordPress"
2020-06-08 22:21:28 +00:00
exit 1
fi
else
echo "$0: Error - no webserver specified in configuration"
exit 5
fi
if [ "$success" -eq 1 ] ; then
ufw allow http \
&& ufw allow https
fi
2020-06-08 18:59:06 +00:00
2020-06-12 22:41:13 +00:00
EOSSH