update
This commit is contained in:
parent
adec608f75
commit
9e407d3e88
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export local_domain=''
|
||||||
export local_url=''
|
export local_url=''
|
||||||
export remote_url=''
|
export remote_url=''
|
||||||
|
|
||||||
|
|
|
@ -17,80 +17,43 @@ fi
|
||||||
|
|
||||||
ssh -T $src_ssh << EOSSH
|
ssh -T $src_ssh << EOSSH
|
||||||
|
|
||||||
if [ -n "$php_version" ] ; then
|
ufw allow http && ufw allow https
|
||||||
echo "TODO - install specific PHP version"
|
|
||||||
|
if [ -n "$apache2_version" ] ; then
|
||||||
|
echo "TODO install apache"
|
||||||
exit 1
|
exit 1
|
||||||
elif ! php ; then
|
|
||||||
apt install -y php-fpm php-bcmath php-curl php-gd php-imagick php-mbstring \
|
|
||||||
php-mysql php-soap php-xml php-zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
EOSSH
|
elif [ -n "$nginx_version" ] ; then
|
||||||
|
echo "TODO install nginx"
|
||||||
|
exit 1
|
||||||
|
|
||||||
ssh -T $src_ssh <<'EOSSH'
|
elif [ -n "$litespeed_version" ] ; then
|
||||||
php_config_file=$(php --ini | grep Loaded | awk '{ print $4 }')
|
if [ "$litespeed_version" != 'latest' ] ; then
|
||||||
sed -i '/memory_limit/c\memory_limit = 256M' "$php_config_file"
|
echo "TODO install specific litespeed version"
|
||||||
sed -i '/upload_max_filesize/c\upload_max_filesize = 64M' "$php_config_file"
|
echo ""
|
||||||
sed -i '/post_max_size/c\post_max_size = 64M' "$php_config_file"
|
echo "Specify \"litespeed_version='latest'\" to install current version."
|
||||||
sed -i '/max_execution_time/c\max_execution_time = 300' "$php_config_file"
|
exit 1
|
||||||
sed -i '/max_input_time/c\max_input_time = 1000' "$php_config_file"
|
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" \
|
||||||
|
--wordpressplus "$src_url" \
|
||||||
|
--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" \
|
||||||
|
&& ufw allow 7080
|
||||||
|
else
|
||||||
|
echo "TODO install litespeed without WordPress"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
EOSSH
|
|
||||||
|
|
||||||
ssh -T $src_ssh << EOSSH
|
|
||||||
|
|
||||||
# install wp-cli first
|
|
||||||
if [ ! -f /usr/local/bin/wp ] ; then
|
|
||||||
wget -nv -O /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
|
|
||||||
&& chmod +x /usr/local/bin/wp
|
|
||||||
fi
|
|
||||||
|
|
||||||
if wp core is-installed --quiet --path="$wp_path" --allow-root ; then
|
|
||||||
echo "WordPress already installed"
|
|
||||||
else
|
else
|
||||||
echo "TODO - install WordPress"
|
echo "$0: Error - no webserver specified in configuration"
|
||||||
|
exit 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$wp_themes" ] ; then
|
|
||||||
printf "\nInstalling themes ..."
|
|
||||||
option='--activate'
|
|
||||||
for theme in $wp_themes ; do
|
|
||||||
echo " installing $theme ..."
|
|
||||||
wp theme install $theme "$option" --path="$wp_path" --allow-root
|
|
||||||
option=''
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$wp_plugins" ] ; then
|
|
||||||
printf "\nInstalling plugins ..."
|
|
||||||
for plugin in $wp_plugins ; do
|
|
||||||
echo " installing $plugin ..."
|
|
||||||
wp plugin install $plugin --path="$wp_path" --allow-root
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$wp_plugins_active" ] ; then
|
|
||||||
printf "\nInstalling plugins to activate ..."
|
|
||||||
for plugin in $wp_plugins_active ; do
|
|
||||||
echo " installing $plugin ..."
|
|
||||||
wp plugin install $plugin --activate --path="$wp_path" --allow-root
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$wp_plugins_active" ] ; then
|
|
||||||
printf "\nUninstalling plugins ..."
|
|
||||||
for plugin in $wp_plugins_uninstall ; do
|
|
||||||
echo " installing $plugin ..."
|
|
||||||
wp plugin deactivate $plugin --path="$wp_path" --allow-root
|
|
||||||
wp plugin uninstall $plugin --path="$wp_path" --allow-root
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO determine web user programatically
|
|
||||||
ownergroup='www-data:www-data'
|
|
||||||
if [ -n "$litespeed_version" ] ; then
|
|
||||||
ownergroup='nobody:nogroup'
|
|
||||||
fi
|
|
||||||
|
|
||||||
chown -R "$ownergroup" "$wp_path"
|
|
||||||
EOSSH
|
EOSSH
|
||||||
|
|
Loading…
Reference in New Issue