added some color fixes, not finished
This commit is contained in:
parent
21a121918e
commit
9b8670f4e4
@ -4,6 +4,15 @@
|
|||||||
# get the current position
|
# get the current position
|
||||||
_cwd="$(pwd)"
|
_cwd="$(pwd)"
|
||||||
|
|
||||||
|
echo -e '\033[35m
|
||||||
|
_______ __
|
||||||
|
/ ____(_) /_
|
||||||
|
/ / __/ / __/
|
||||||
|
/ /_/ / / /_
|
||||||
|
\____/_/\__/
|
||||||
|
\033[0m'
|
||||||
|
echo -e "\033[35;1mCreate new git barre repos and deploy script\033[0m"
|
||||||
|
|
||||||
|
|
||||||
while [ "$_bare_name" = "" ]
|
while [ "$_bare_name" = "" ]
|
||||||
do
|
do
|
||||||
|
76
bin/lemp.sh
76
bin/lemp.sh
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
__
|
__
|
||||||
/ /__ ____ ___ ____
|
/ /__ ____ ___ ____
|
||||||
/ / _ \/ __ `__ \/ __ \
|
/ / _ \/ __ `__ \/ __ \
|
||||||
@ -8,16 +8,16 @@ echo '\033[35m
|
|||||||
/_/\___/_/ /_/ /_/ .___/
|
/_/\___/_/ /_/ /_/ .___/
|
||||||
/_/
|
/_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m"
|
echo -e "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m"
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
echo "Please run as root"
|
echo -e "Please run as root"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
__ ___ __
|
__ ___ __
|
||||||
/ |/ /_ ___________ _/ /
|
/ |/ /_ ___________ _/ /
|
||||||
/ /|_/ / / / / ___/ __ `/ /
|
/ /|_/ / / / / ___/ __ `/ /
|
||||||
@ -25,29 +25,29 @@ echo '\033[35m
|
|||||||
/_/ /_/\__, /____/\__, /_/
|
/_/ /_/\__, /____/\__, /_/
|
||||||
/____/ /_/
|
/____/ /_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1minstalling Mysql \033[0m"
|
echo -e "\033[35;1minstalling Mysql \033[0m"
|
||||||
sleep 3
|
sleep 3
|
||||||
apt-get --yes --force-yes install mariadb-server
|
apt-get --yes --force-yes install mariadb-server
|
||||||
mysql_secure_installation
|
mysql_secure_installation
|
||||||
systemctl enable mariadb.service
|
systemctl enable mariadb.service
|
||||||
systemctl restart mariadb.service
|
systemctl restart mariadb.service
|
||||||
echo "\033[92;1mmysql installed\033[Om"
|
echo -e "\033[92;1mmysql installed\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
____ __ ______
|
____ __ ______
|
||||||
/ __ \/ / / / __ \
|
/ __ \/ / / / __ \
|
||||||
/ /_/ / /_/ / /_/ /
|
/ /_/ / /_/ / /_/ /
|
||||||
/ ____/ __ / ____/
|
/ ____/ __ / ____/
|
||||||
/_/ /_/ /_/_/
|
/_/ /_/ /_/_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling PHP 7.0 \033[0m"
|
echo -e "\033[35;1mInstalling PHP 7.0 \033[0m"
|
||||||
sleep 3
|
sleep 3
|
||||||
apt-get --yes --force-yes install php7.0-fpm php7.0-mysql php7.0-opcache php7.0-curl php7.0-mbstring php7.0-zip php7.0-xml php7.0-gd php7.0-mcrypt php-memcached
|
apt-get --yes --force-yes install php7.0-fpm php7.0-mysql php7.0-opcache php7.0-curl php7.0-mbstring php7.0-zip php7.0-xml php7.0-gd php7.0-mcrypt php-memcached
|
||||||
|
|
||||||
mv /etc/php/7.0/fpm/php.ini /etc/php/7.0/fpm/php.ini.back
|
mv /etc/php/7.0/fpm/php.ini /etc/php/7.0/fpm/php.ini.back
|
||||||
cp "$_cwd"/assets/php-fpm.ini /etc/php/7.0/fpm/php.ini
|
cp "$_cwd"/assets/php-fpm.ini /etc/php/7.0/fpm/php.ini
|
||||||
|
|
||||||
echo "Configuring PHP"
|
echo -e "Configuring PHP"
|
||||||
|
|
||||||
mkdir /var/log/php
|
mkdir /var/log/php
|
||||||
chown www-data /var/log/php
|
chown www-data /var/log/php
|
||||||
@ -56,16 +56,16 @@ cp "$_cwd"/assets/logrotate-php /etc/logrotate.d/php
|
|||||||
systemctl enable php7.0-fpm
|
systemctl enable php7.0-fpm
|
||||||
systemctl start php7.0-fpm
|
systemctl start php7.0-fpm
|
||||||
|
|
||||||
# echo "Installing memecached"
|
# echo -e "Installing memecached"
|
||||||
# replaced by redis
|
# replaced by redis
|
||||||
# apt-get --yes --force-yes install memcached
|
# apt-get --yes --force-yes install memcached
|
||||||
# sed -i "s/-m\s64/-m 128/g" /etc/memcached.conf
|
# sed -i "s/-m\s64/-m 128/g" /etc/memcached.conf
|
||||||
#
|
#
|
||||||
# systemctl start memcached
|
# systemctl start memcached
|
||||||
|
|
||||||
echo "\033[92;1mphp installed\033[Om"
|
echo -e "\033[92;1mphp installed\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
_ __ _
|
_ __ _
|
||||||
/ | / /___ _(_)___ _ __
|
/ | / /___ _(_)___ _ __
|
||||||
/ |/ / __ `/ / __ \| |/_/
|
/ |/ / __ `/ / __ \| |/_/
|
||||||
@ -73,7 +73,7 @@ echo '\033[35m
|
|||||||
/_/ |_/\__, /_/_/ /_/_/|_|
|
/_/ |_/\__, /_/_/ /_/_/|_|
|
||||||
/____/
|
/____/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling Nginx \033[0m"
|
echo -e "\033[35;1mInstalling Nginx \033[0m"
|
||||||
sleep 3
|
sleep 3
|
||||||
apt-get --yes --force-yes install nginx
|
apt-get --yes --force-yes install nginx
|
||||||
mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.ori
|
mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.ori
|
||||||
@ -81,9 +81,9 @@ cp "$_cwd"/assets/default.nginxconf /etc/nginx/sites-available/default
|
|||||||
|
|
||||||
systemctl enable nginx
|
systemctl enable nginx
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
echo "\033[92;1mNginx installed\033[Om"
|
echo -e "\033[92;1mNginx installed\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
__ __ ___ ___ __ _
|
__ __ ___ ___ __ _
|
||||||
____ / /_ ____ / |/ /_ __/ | ____/ /___ ___ (_)___
|
____ / /_ ____ / |/ /_ __/ | ____/ /___ ___ (_)___
|
||||||
/ __ \/ __ \/ __ \/ /|_/ / / / / /| |/ __ / __ `__ \/ / __ \
|
/ __ \/ __ \/ __ \/ /|_/ / / / / /| |/ __ / __ `__ \/ / __ \
|
||||||
@ -91,38 +91,38 @@ echo '\033[35m
|
|||||||
/ .___/_/ /_/ .___/_/ /_/\__, /_/ |_\__,_/_/ /_/ /_/_/_/ /_/
|
/ .___/_/ /_/ .___/_/ /_/\__, /_/ |_\__,_/_/ /_/ /_/_/_/ /_/
|
||||||
/_/ /_/ /____/
|
/_/ /_/ /____/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling phpMyAdmin \033[0m"
|
echo -e "\033[35;1mInstalling phpMyAdmin \033[0m"
|
||||||
apt-get --yes --force-yes install phpmyadmin
|
apt-get --yes --force-yes install phpmyadmin
|
||||||
ln -s /usr/share/phpmyadmin /var/www/html/
|
ln -s /usr/share/phpmyadmin /var/www/html/
|
||||||
# cp "$_cwd"/assets/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
|
# cp "$_cwd"/assets/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
|
||||||
# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
|
# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
|
||||||
|
|
||||||
# echo "\033[35;1msecuring phpMyAdmin \033[0m"
|
# echo -e "\033[35;1msecuring phpMyAdmin \033[0m"
|
||||||
# sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/"
|
# sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/"
|
||||||
# cp "$_cwd"/assets/phpmyadmin_htaccess > /usr/share/phpmyadmin/.htaccess
|
# cp "$_cwd"/assets/phpmyadmin_htaccess > /usr/share/phpmyadmin/.htaccess
|
||||||
# echo -n "define a user name for phpmyadmin : "
|
# echo -n "define a user name for phpmyadmin : "
|
||||||
# read un
|
# read un
|
||||||
# htpasswd -c /etc/phpmyadmin/.htpasswd $un
|
# htpasswd -c /etc/phpmyadmin/.htpasswd $un
|
||||||
# service apache2 restart
|
# service apache2 restart
|
||||||
echo "\033[92;1mphpMyAdmin installed\033[Om"
|
echo -e "\033[92;1mphpMyAdmin installed\033[Om"
|
||||||
echo "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om"
|
echo -e "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
____ ___
|
____ ___
|
||||||
/ __ \___ ____/ (_)____
|
/ __ \___ ____/ (_)____
|
||||||
/ /_/ / _ \/ __ / / ___/
|
/ /_/ / _ \/ __ / / ___/
|
||||||
/ _, _/ __/ /_/ / (__ )
|
/ _, _/ __/ /_/ / (__ )
|
||||||
/_/ |_|\___/\__,_/_/____/
|
/_/ |_|\___/\__,_/_/____/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling Redis \033[0m"
|
echo -e "\033[35;1mInstalling Redis \033[0m"
|
||||||
sleep 3
|
sleep 3
|
||||||
apt-get --yes --force-yes install redis-server php-redis
|
apt-get --yes --force-yes install redis-server php-redis
|
||||||
|
|
||||||
systemctl enable redis-server
|
systemctl enable redis-server
|
||||||
systemctl restart redis-server
|
systemctl restart redis-server
|
||||||
echo "\033[92;1mRedis installed\033[Om"
|
echo -e "\033[92;1mRedis installed\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
______
|
______
|
||||||
/ ____/___ ____ ___ ____ ____ ________ _____
|
/ ____/___ ____ ___ ____ ____ ________ _____
|
||||||
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
|
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
|
||||||
@ -130,39 +130,39 @@ echo '\033[35m
|
|||||||
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
|
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
|
||||||
/_/
|
/_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling Composer \033[0m"
|
echo -e "\033[35;1mInstalling Composer \033[0m"
|
||||||
sleep 3
|
sleep 3
|
||||||
export COMPOSER_HOME=/usr/local/composer
|
export COMPOSER_HOME=/usr/local/composer
|
||||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
echo "\033[92;1mComposer installed\033[Om"
|
echo -e "\033[92;1mComposer installed\033[Om"
|
||||||
|
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
____ __
|
____ __
|
||||||
/ __ \_______ _______/ /_
|
/ __ \_______ _______/ /_
|
||||||
/ / / / ___/ / / / ___/ __ \
|
/ / / / ___/ / / / ___/ __ \
|
||||||
/ /_/ / / / /_/ (__ ) / / /
|
/ /_/ / / / /_/ (__ ) / / /
|
||||||
/_____/_/ \__,_/____/_/ /_/
|
/_____/_/ \__,_/____/_/ /_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling Drush and DrupalConsole\033[0m"
|
echo -e "\033[35;1mInstalling Drush and DrupalConsole\033[0m"
|
||||||
sleep 3
|
sleep 3
|
||||||
curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal
|
curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal
|
||||||
chmod +x /usr/local/bin/drupal
|
chmod +x /usr/local/bin/drupal
|
||||||
curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar -L -o /usr/local/bin/drush
|
curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar -L -o /usr/local/bin/drush
|
||||||
chmod +x /usr/local/bin/drush
|
chmod +x /usr/local/bin/drush
|
||||||
echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
|
echo -e "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO supervising
|
# TODO supervising
|
||||||
# echo '\033[35m
|
# echo -e '\033[35m
|
||||||
# __ ___ _ __ __ __ ___ _
|
# __ ___ _ __ __ __ ___ _
|
||||||
# / |/ /__ ___ (_) /_ _/_/ / |/ /_ _____ (_)__
|
# / |/ /__ ___ (_) /_ _/_/ / |/ /_ _____ (_)__
|
||||||
# / /|_/ / _ \/ _ \/ / __/ _/_/ / /|_/ / // / _ \/ / _ \
|
# / /|_/ / _ \/ _ \/ / __/ _/_/ / /|_/ / // / _ \/ / _ \
|
||||||
# /_/ /_/\___/_//_/_/\__/ /_/ /_/ /_/\_,_/_//_/_/_//_/
|
# /_/ /_/\___/_//_/_/\__/ /_/ /_/ /_/\_,_/_//_/_/_//_/
|
||||||
# \033[0m'
|
# \033[0m'
|
||||||
# echo "\033[35;1mInstalling Munin \033[0m"
|
# echo -e "\033[35;1mInstalling Munin \033[0m"
|
||||||
# sleep 3
|
# sleep 3
|
||||||
# # https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-debian/
|
# # https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-debian/
|
||||||
# apt-get --yes --force-yes install munin munin-node munin-plugins-extra
|
# apt-get --yes --force-yes install munin munin-node munin-plugins-extra
|
||||||
@ -199,9 +199,9 @@ echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
|
|||||||
#
|
#
|
||||||
# service apache2 restart
|
# service apache2 restart
|
||||||
# service munin-node restart
|
# service munin-node restart
|
||||||
# echo "\033[92;1mMunin installed\033[Om"
|
# echo -e "\033[92;1mMunin installed\033[Om"
|
||||||
#
|
#
|
||||||
# echo "\033[35;1mInstalling Monit \033[0m"
|
# echo -e "\033[35;1mInstalling Monit \033[0m"
|
||||||
# sleep 3
|
# sleep 3
|
||||||
# # https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-debian/2/
|
# # https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-debian/2/
|
||||||
# apt-get --yes --force-yes install monit
|
# apt-get --yes --force-yes install monit
|
||||||
@ -220,7 +220,7 @@ echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
|
|||||||
# sed -i 's/PASSWD_TO_REPLACE/$passwda/g' /etc/monit/monitrc
|
# sed -i 's/PASSWD_TO_REPLACE/$passwda/g' /etc/monit/monitrc
|
||||||
# passok=1
|
# passok=1
|
||||||
# else
|
# else
|
||||||
# echo "pass words don't match, please try again"
|
# echo -e "pass words don't match, please try again"
|
||||||
# fi
|
# fi
|
||||||
# done
|
# done
|
||||||
#
|
#
|
||||||
@ -228,21 +228,21 @@ echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
|
|||||||
# sed -i "s/server1\.example\.com/$HOSTNAME/g" /etc/monit/monitrc
|
# sed -i "s/server1\.example\.com/$HOSTNAME/g" /etc/monit/monitrc
|
||||||
#
|
#
|
||||||
# mkdir /var/www/html/monit
|
# mkdir /var/www/html/monit
|
||||||
# echo "hello" > /var/www/html/monit/token
|
# echo -e "hello" > /var/www/html/monit/token
|
||||||
#
|
#
|
||||||
# service monit start
|
# service monit start
|
||||||
#
|
#
|
||||||
# echo "\033[92;1mMonit installed\033[Om"
|
# echo -e "\033[92;1mMonit installed\033[Om"
|
||||||
|
|
||||||
|
|
||||||
# echo '\033[35m
|
# echo -e '\033[35m
|
||||||
# ___ __ __
|
# ___ __ __
|
||||||
# / |_ _______/ /_____ _/ /_
|
# / |_ _______/ /_____ _/ /_
|
||||||
# / /| | | /| / / ___/ __/ __ `/ __/
|
# / /| | | /| / / ___/ __/ __ `/ __/
|
||||||
# / ___ | |/ |/ (__ ) /_/ /_/ / /_
|
# / ___ | |/ |/ (__ ) /_/ /_/ / /_
|
||||||
# /_/ |_|__/|__/____/\__/\__,_/\__/
|
# /_/ |_|__/|__/____/\__/\__,_/\__/
|
||||||
# \033[0m'
|
# \033[0m'
|
||||||
# echo "\033[35;1mInstalling Awstat \033[0m"
|
# echo -e "\033[35;1mInstalling Awstat \033[0m"
|
||||||
# sleep 3
|
# sleep 3
|
||||||
# apt-get --yes --force-yes install awstats
|
# apt-get --yes --force-yes install awstats
|
||||||
# # Configure AWStats
|
# # Configure AWStats
|
||||||
@ -252,4 +252,4 @@ echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
|
|||||||
# fi
|
# fi
|
||||||
# # Disable Awstats from executing every 10 minutes. Put a hash in front of any line.
|
# # Disable Awstats from executing every 10 minutes. Put a hash in front of any line.
|
||||||
# sed -i 's/^[^#]/#&/' /etc/cron.d/awstats
|
# sed -i 's/^[^#]/#&/' /etc/cron.d/awstats
|
||||||
# echo "\033[92;1mAwstat installed\033[Om"
|
# echo -e "\033[92;1mAwstat installed\033[Om"
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
__ _______ __________
|
__ _______ __________
|
||||||
/ / / / ___// ____/ __ \
|
/ / / / ___// ____/ __ \
|
||||||
/ / / /\__ \/ __/ / /_/ /
|
/ / / /\__ \/ __/ / /_/ /
|
||||||
/ /_/ /___/ / /___/ _, _/
|
/ /_/ /___/ / /___/ _, _/
|
||||||
\____//____/_____/_/ |_|
|
\____//____/_____/_/ |_|
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m"
|
echo -e "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m"
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
echo "Please run as root"
|
echo "Please run as root"
|
||||||
@ -45,4 +45,4 @@ groupadd admin
|
|||||||
usermod -a -G admin "$user"
|
usermod -a -G admin "$user"
|
||||||
# allow admin group to su
|
# allow admin group to su
|
||||||
dpkg-statoverride --update --add root admin 4750 /bin/su
|
dpkg-statoverride --update --add root admin 4750 /bin/su
|
||||||
echo "\033[92;1muser $user configured\033[Om"
|
echo -e "\033[92;1muser $user configured\033[Om"
|
||||||
|
20
bin/vhost.sh
20
bin/vhost.sh
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
__ __
|
__ __
|
||||||
_ __/ /_ ____ _____/ /_
|
_ __/ /_ ____ _____/ /_
|
||||||
| | / / __ \/ __ \/ ___/ __/
|
| | / / __ \/ __ \/ ___/ __/
|
||||||
| |/ / / / / /_/ (__ ) /_
|
| |/ / / / / /_/ (__ ) /_
|
||||||
|___/_/ /_/\____/____/\__/
|
|___/_/ /_/\____/____/\__/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mNginx VHOST install \033[0m"
|
echo -e "\033[35;1mNginx VHOST install \033[0m"
|
||||||
while [ "$vh" != "y" ] && [ "$vh" != "n" ]
|
while [ "$vh" != "y" ] && [ "$vh" != "n" ]
|
||||||
do
|
do
|
||||||
echo -n "Should we install a vhost? [y|n] "
|
echo -n "Should we install a vhost? [y|n] "
|
||||||
@ -38,8 +38,8 @@ if [ "$vh" = "y" ]; then
|
|||||||
# ask for let's encrypt
|
# ask for let's encrypt
|
||||||
while [ "$_letsencrypt" != "yes" ] && [ "$_letsencrypt" != "no" ]
|
while [ "$_letsencrypt" != "yes" ] && [ "$_letsencrypt" != "no" ]
|
||||||
do
|
do
|
||||||
echo "Let's encrypt"
|
echo -e "Let's encrypt"
|
||||||
echo "Let's encrypt needs a public registered domain name with proper DNS records ( A records or CNAME records for subdomains pointing to your server)."
|
echo -e "Let's encrypt needs a public registered domain name with proper DNS records ( A records or CNAME records for subdomains pointing to your server)."
|
||||||
echo -n "Should we install let's encrypt certificate with $_domain? [yes|no] "
|
echo -n "Should we install let's encrypt certificate with $_domain? [yes|no] "
|
||||||
read _letsencrypt
|
read _letsencrypt
|
||||||
done
|
done
|
||||||
@ -53,7 +53,7 @@ if [ "$vh" = "y" ]; then
|
|||||||
# TODO renewing
|
# TODO renewing
|
||||||
touch /var/spool/crontab/root
|
touch /var/spool/crontab/root
|
||||||
crontab -l > mycron
|
crontab -l > mycron
|
||||||
echo "0 3 * * * certbot renew --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' --cert-name $_domain" >> mycron
|
echo -e "0 3 * * * certbot renew --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' --cert-name $_domain" >> mycron
|
||||||
crontab mycron
|
crontab mycron
|
||||||
rm mycron
|
rm mycron
|
||||||
fi
|
fi
|
||||||
@ -105,14 +105,14 @@ if [ "$vh" = "y" ]; then
|
|||||||
user=""
|
user=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "user $user doesn't exists, you must provide an existing user"
|
echo -e "user $user doesn't exists, you must provide an existing user"
|
||||||
user=""
|
user=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "shortcut will be installed for '$user'";
|
echo -e "shortcut will be installed for '$user'";
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
mkdir /home/"$user"/www/
|
mkdir /home/"$user"/www/
|
||||||
@ -120,14 +120,14 @@ if [ "$vh" = "y" ]; then
|
|||||||
ln -s /var/www/"$_domain" /home/"$user"/www/"$_domain"
|
ln -s /var/www/"$_domain" /home/"$user"/www/"$_domain"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo 'no shortcut installed'
|
echo -e 'no shortcut installed'
|
||||||
fi
|
fi
|
||||||
# activate the vhost
|
# activate the vhost
|
||||||
ln -s /etc/nginx/sites-available/"$_domain".conf /etc/nginx/sites-enabled/"$_domain".conf
|
ln -s /etc/nginx/sites-available/"$_domain".conf /etc/nginx/sites-enabled/"$_domain".conf
|
||||||
|
|
||||||
# restart nginx
|
# restart nginx
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
echo "\033[92;1mvhost $_domain configured\033[Om"
|
echo -e "\033[92;1mvhost $_domain configured\033[Om"
|
||||||
else
|
else
|
||||||
echo "Vhost installation aborted"
|
echo -e "Vhost installation aborted"
|
||||||
fi
|
fi
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# http://web-74.com/blog/reseaux/gerer-le-deploiement-facilement-avec-git/
|
# http://web-74.com/blog/reseaux/gerer-le-deploiement-facilement-avec-git/
|
||||||
#
|
#
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
____ __ _ _____
|
____ __ _ _____
|
||||||
/ __ \___ / /_ (_)___ _____ / ___/___ ______ _____ _____
|
/ __ \___ / /_ (_)___ _____ / ___/___ ______ _____ _____
|
||||||
/ / / / _ \/ __ \/ / __ `/ __ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
|
/ / / / _ \/ __ \/ / __ `/ __ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
|
||||||
@ -13,10 +13,10 @@ echo '\033[35m
|
|||||||
/_____/\___/_.___/_/\__,_/_/ /_/ /____/\___/_/ |___/\___/_/
|
/_____/\___/_.___/_/\__,_/_/ /_/ /____/\___/_/ |___/\___/_/
|
||||||
|
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mThis script has been tested only on Linux Debian 9 \033[0m"
|
echo -e "\033[35;1mThis script has been tested only on Linux Debian 9 \033[0m"
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
echo "Please run as root"
|
echo -e "Please run as root"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ echo -n "Should we start? [Y|n] "
|
|||||||
read yn
|
read yn
|
||||||
yn=${yn:-y}
|
yn=${yn:-y}
|
||||||
if [ "$yn" != "y" ]; then
|
if [ "$yn" != "y" ]; then
|
||||||
echo "aborting script!"
|
echo -e "aborting script!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ done
|
|||||||
if [ "$securssh" = "yes" ]; then
|
if [ "$securssh" = "yes" ]; then
|
||||||
. bin/ssh.sh
|
. bin/ssh.sh
|
||||||
else
|
else
|
||||||
echo 'root user can still conect through ssh'
|
echo -e 'root user can still conect through ssh'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ yn=${yn:-y}
|
|||||||
if [ "$yn" = "y" ]; then
|
if [ "$yn" = "y" ]; then
|
||||||
. bin/ftp.sh
|
. bin/ftp.sh
|
||||||
else
|
else
|
||||||
echo 'ftp server not installed'
|
echo -e 'ftp server not installed'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [ "$lemp" != "yes" ] && [ "$lemp" != "no" ]
|
while [ "$lemp" != "yes" ] && [ "$lemp" != "no" ]
|
||||||
@ -69,7 +69,7 @@ done
|
|||||||
if [ "$lemp" = "yes" ]; then
|
if [ "$lemp" = "yes" ]; then
|
||||||
. bin/lemp.sh
|
. bin/lemp.sh
|
||||||
else
|
else
|
||||||
echo 'lemp server not installed'
|
echo -e 'lemp server not installed'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. bin/vhost.sh
|
. bin/vhost.sh
|
||||||
@ -77,7 +77,7 @@ fi
|
|||||||
. bin/dotfiles.sh
|
. bin/dotfiles.sh
|
||||||
. bin/autoupdate.sh
|
. bin/autoupdate.sh
|
||||||
|
|
||||||
# echo '\033[35m
|
# echo -e '\033[35m
|
||||||
# ______________ _______
|
# ______________ _______
|
||||||
# /_ __/ ____/ |/ / __ \
|
# /_ __/ ____/ |/ / __ \
|
||||||
# / / / __/ / /|_/ / /_/ /
|
# / / / __/ / /|_/ / /_/ /
|
||||||
@ -107,7 +107,7 @@ fi
|
|||||||
|
|
||||||
# mount -t tmpfs -o rw,noexec,nosuid tmpfs /tmp
|
# mount -t tmpfs -o rw,noexec,nosuid tmpfs /tmp
|
||||||
# chmod 1777 /tmp
|
# chmod 1777 /tmp
|
||||||
# echo "tmpfs /tmp tmpfs rw,noexec,nosuid 0 0" >> /etc/fstab
|
# echo -e "tmpfs /tmp tmpfs rw,noexec,nosuid 0 0" >> /etc/fstab
|
||||||
|
|
||||||
# # Restore /tmp
|
# # Restore /tmp
|
||||||
# cp -Rpf /tmpbackup/* /tmp/ >/dev/null 2>&1
|
# cp -Rpf /tmpbackup/* /tmp/ >/dev/null 2>&1
|
||||||
@ -140,11 +140,11 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '\033[35m
|
echo -e '\033[35m
|
||||||
__
|
__
|
||||||
___ ____ ____/ /
|
___ ____ ____/ /
|
||||||
/ _ \/ __ \/ __ /
|
/ _ \/ __ \/ __ /
|
||||||
/ __/ / / / /_/ /
|
/ __/ / / / /_/ /
|
||||||
\___/_/ /_/\__,_/
|
\___/_/ /_/\__,_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1m* * script done * * \033[0m"
|
echo -e "\033[35;1m* * script done * * \033[0m"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user