Initial Commit.

This commit is contained in:
2019-11-15 19:27:27 +00:00
parent 468ce973b5
commit a2b57b2426
18 changed files with 467 additions and 0 deletions
+82
View File
@@ -0,0 +1,82 @@
#!/bin/bash
# install common software, will prompt before each step
echo "----- Use nginx straight from nginx.org -------------"
read -p 'Add nginx.org to apt source list? [y/N]: ' add_nginx
case $add_nginx in
[Yy]* )
echo 'Adding nginx.org'
# check that such a distro/release exists on nginx.org
distro=`lsb_release -i -s | tr '[:upper:]' '[:lower:]'`
release=`lsb_release -c -s`
http_code=`curl -s -o /dev/null --connect-timeout 0.5 -I -w "%{http_code}" "https://nginx.org/packages/$distro/dists/$release/nginx/"`
if [[ "$http_code" == "200" ]]; then
(
cat << NGINX
deb https://nginx.org/packages/$distro/ $release nginx
deb-src https://nginx.org/packages/$distro/ $release nginx
NGINX
) | sudo tee /etc/apt/sources.list.d/nginx.list
curl -L https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
else
echo "nginx.org appears to be missing $distro/$release"
fi
;;
* )
echo 'Skipping'
;;
esac
# ----------------------------------------------------------
called_update=false
function install_collection () {
read -p "Install $1? [y/N]: " response
case $response in
[Yy]* )
if [ $called_update = false ]; then
echo "Updating APT before Installing"
sudo apt update
called_update=true
fi
echo "Installing $1"
sudo apt install "${@:2}"
;;
* )
echo 'Skipping'
;;
esac
}
# ----------------------------------------------------------
echo "----- Install extra utilities: ncdu, zip ------------"
install_collection 'extra utilities' ncdu zip unzip
echo "----- Install nginx + php-fpm + certbot -------------"
install_collection 'nginx, php-fpm, certbot' nginx certbot python-certbot-nginx php-cli php-fpm php-curl php-gd php-imagick php-intl php-json php-mbstring php-mysql php-redis php-soap php-xml php-yaml php-zip
echo "----- Add nginx logging conf ------------------------"
read -p 'Install the "tabbed_detailed" nginx log format? [y/N]: ' nginx_log
case $nginx_log in
[Yy]* )
LOCATION=`dirname "$0"`
mkdir -p "/etc/nginx/conf.d"
sudo cp "${LOCATION}/nginx/logging.conf" "/etc/nginx/conf.d/logging.conf"
;;
* )
echo 'Skipping'
;;
esac
echo "----- Install redis-server --------------------------"
install_collection 'redis-server' redis-server
echo "----- Install mariadb-server ------------------------"
install_collection 'mariadb-server' mariadb-server
echo "----- Install ruby + build-essential ----------------"
install_collection 'ruby, build-essential' ruby-full build-essential zlib1g-dev