Please review my 12 lines Ubuntu-Nginx environment script

January 22, 2018 394 views
Nginx Ubuntu 16.04

Please review my 12 lines Ubuntu-Nginx environment script:

#!/bin/bash
ufw --force enable && ufw allow 22,25,80,443,9000/tcp
apt-get update -y && add-apt-repository ppa:certbot/certbot -y && apt-get update -y
apt-get upgrade zip unzip tree unattended-upgrades sshguard nginx python-certbot-nginx mysql-server php-fpm php-mysql php-mbstring php-mcrypt -y
DEBIAN_FRONTEND=noninteractive apt-get upgrade postfix -y
sed -i "s/post_max_size = .M/post_max_size = 250M/ ; s/upload_max_filesize = .M/upload_max_filesize = 250M/" /etc/php/*/fpm/php.ini
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/*/fpm/php.ini
wget -P ~/myAddons/ https://raw.githubusercontent.com/benqzq/unse/master/{nwsm.sh,pma.sh,imb.sh,daily.sh,weekly.sh,appendix.sh}
curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > /usr/local/bin/wp
echo -e "0 0 * * * ~/myAddons/daily.sh \n0 0 * * 0 ~/myAddons/weekly.sh" | crontab
chmod +x ~/myAddons/* /usr/local/bin/wp && source ~/myAddons/appendix.sh && rss
# sed -i "s/# gzip_/gzip_/g" /etc/nginx/nginx.conf

What can I shorten/automate here? It feels to me a bit heavy, even though it is quite short.

Comfortable Github link.

Be the first one to answer this question.