diff --git a/post/run.sh b/post/run.sh index 9fe249c..4fb8400 100644 --- a/post/run.sh +++ b/post/run.sh @@ -1,8 +1,11 @@ #!/bin/bash REPO=https://git.xoservice.nl/marcel/archlinux +GREEN='\033[0;32m' +RED='\033[0;31m' +NOCOL='\033[om' -echo "Setting remote control requirements..." +echo -e "${GREEN}Setting remote control requirements...${NOCOL}" groupadd admins useradd -g admins -m -r -c "System administrator" sysadmin echo "%admins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/admins @@ -11,25 +14,25 @@ chmod 700 /home/sysadmin/.ssh curl -so /home/sysadmin/.ssh/authorized_keys $REPO/raw/master/post/ansible.pub chown -R sysadmin:admins /home/sysadmin/.ssh -echo "Disable root user SSH access..." +echo -e "${GREEN}Disable root user SSH access...${NOCOL}" sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config sed -i 's/PermitRootLogin without-password/PermitRootLogin no/' /etc/ssh/sshd_config -echo "Configuring and enabling default firewall..." +echo -e "${GREEN}Configuring and enabling default firewall...${NOCOL}" curl -so /etc/iptables/iptables.rules $REPO/raw/master/post/iptables.rules curl -so /etc/iptables/ip6tables.rules $REPO/raw/master/post/ip6tables.rules systemctl enable iptables systemctl enable ip6tables -echo "Install minimal required packages..." +echo -e "${GREEN}Install minimal required packages...${NOCOL}" pacman --noconfirm -S iftop htop bash-completion iotop lsof screen neofetch neovim man-db ln -s /usr/bin/nvim /usr/bin/vi -echo "Setup motd default..." +echo -e "${GREEN}Setup motd default...${NOCOL}" echo "" > /etc/motd echo "neofetch" >> /etc/profile.d/neofetch.sh chmod +x /etc/profile.d/neofetch.sh -echo "All done, reboot in 5 seconds..." -sleep 5 +echo -e "${RED}All done, reboot in 10 seconds...${NOCOL}" +sleep 10 reboot