added root check and needrestart check
This commit is contained in:
parent
0e81a4ab11
commit
c1eefcd6fc
@ -9,10 +9,13 @@ echo '\033[35m
|
|||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mEnable mail sending for php \033[0m"
|
echo "\033[35;1mEnable mail sending for php \033[0m"
|
||||||
|
|
||||||
# TODO check if root
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13
|
# http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13
|
||||||
sleep 3
|
sleep 2
|
||||||
apt-get --yes --force-yes install exim4
|
apt-get --yes --force-yes install exim4
|
||||||
echo "\033[35;1mConfiguring EXIM4 \033[0m"
|
echo "\033[35;1mConfiguring EXIM4 \033[0m"
|
||||||
while [ "$configexim" != "y" ] && [ "$configexim" != "n" ]
|
while [ "$configexim" != "y" ] && [ "$configexim" != "n" ]
|
||||||
|
@ -10,6 +10,13 @@ echo '\033[35m
|
|||||||
/_/ \__,_/_/_//____/_.___/\__,_/_/ /_/
|
/_/ \__,_/_/_//____/_.___/\__,_/_/ /_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling fall2ban \033[0m"
|
echo "\033[35;1mInstalling fall2ban \033[0m"
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 2
|
||||||
apt-get --yes --force-yes install fail2ban
|
apt-get --yes --force-yes install fail2ban
|
||||||
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
|
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
|
||||||
# ToDo ask for email and configure jail.local with it
|
# ToDo ask for email and configure jail.local with it
|
||||||
|
@ -10,7 +10,13 @@ echo '\033[35m
|
|||||||
/_/ /___/_/ |_/_____/ |__/|__/_/ |_/_____/_____/
|
/_/ /___/_/ |_/_____/ |__/|__/_/ |_/_____/_____/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling ufw and setup firewall (allowing only ssh and http) \033[0m"
|
echo "\033[35;1mInstalling ufw and setup firewall (allowing only ssh and http) \033[0m"
|
||||||
sleep 3
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 2
|
||||||
apt-get --yes --force-yes install ufw
|
apt-get --yes --force-yes install ufw
|
||||||
# ufw allow ssh # knockd will open the ssh port
|
# ufw allow ssh # knockd will open the ssh port
|
||||||
ufw allow http
|
ufw allow http
|
||||||
|
@ -10,7 +10,13 @@ echo '\033[35m
|
|||||||
/_/|_/_/ /_/\____/\___/_/|_|\__,_/
|
/_/|_/_/ /_/\____/\___/_/|_|\__,_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling knockd to control ssh port opening\033[0m"
|
echo "\033[35;1mInstalling knockd to control ssh port opening\033[0m"
|
||||||
sleep 3
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 2
|
||||||
apt-get --yes --force-yes install knockd
|
apt-get --yes --force-yes install knockd
|
||||||
|
|
||||||
mv /etc/knockd.conf /etc/knockd.conf.ori
|
mv /etc/knockd.conf /etc/knockd.conf.ori
|
||||||
|
@ -8,14 +8,15 @@ echo '\033[35m
|
|||||||
/_/\___/_/ /_/ /_/ .___/
|
/_/\___/_/ /_/ /_/ .___/
|
||||||
/_/
|
/_/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mLEMP server (Nginx Mysql Php) \033[0m"
|
echo "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m"
|
||||||
sleep 3
|
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]
|
if [ "$EUID" -ne 0 ]
|
||||||
then echo "Please run as root"
|
then echo "Please run as root"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
|
||||||
echo '\033[35m
|
echo '\033[35m
|
||||||
__ ___ __
|
__ ___ __
|
||||||
/ |/ /_ ___________ _/ /
|
/ |/ /_ ___________ _/ /
|
||||||
|
@ -10,8 +10,15 @@ echo '\033[35m
|
|||||||
/_/ /_/_/____/\___/
|
/_/ /_/_/____/\___/
|
||||||
|
|
||||||
\033[0m'
|
\033[0m'
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
apt-get --yes --force-yes install vim curl
|
apt-get --yes --force-yes install vim curl
|
||||||
sed -i "s/^# en_GB.UTF-8/en_GB.UTF-8/g" /etc/locale.gen
|
sed -i "s/^# en_GB.UTF-8/en_GB.UTF-8/g" /etc/locale.gen
|
||||||
locale-gen
|
locale-gen
|
||||||
apt-get --yes --force-yes install ntp
|
apt-get --yes --force-yes install ntp
|
||||||
dpkg-reconfigure tzdata
|
dpkg-reconfigure tzdata
|
||||||
|
apt-get --yes --force-yes install needrestart
|
||||||
|
@ -9,5 +9,12 @@ echo '\033[35m
|
|||||||
/ /_/ / ____/ /_/ / _, _/ ___ |/ /_/ / /___
|
/ /_/ / ____/ /_/ / _, _/ ___ |/ /_/ / /___
|
||||||
\____/_/ \____/_/ |_/_/ |_/_____/_____/
|
\____/_/ \____/_/ |_/_/ |_/_____/_____/
|
||||||
\033[0m'
|
\033[0m'
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get dist-upgrade
|
apt-get dist-upgrade
|
||||||
|
needrestart -rl
|
||||||
|
@ -8,6 +8,12 @@ echo '\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 "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m"
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
# TODO check if root
|
# TODO check if root
|
||||||
|
Loading…
x
Reference in New Issue
Block a user