diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..da6c43c --- /dev/null +++ b/setup.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ "$(whoami)" != "root" ]; then + SUDO=sudo +fi +#Installs sury's php repository +${SUDO} apt update +${SUDO} apt -y install apt-transport-https lsb-release ca-certificates vim sudo perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python curl certbot shared-mime-info fail2ban unzip git +${SUDO} curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg +${SUDO} sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' +${SUDO} apt update +read -p "Create user?(y/n)? " answer +case ${answer:0:1} in + y|Y ) + read -p "Enter username " USERNAME + ${SUDO} adduser --gecos "" $USERNAME + read -p "Should I add the new user to sudo group?(y/n)? " answer + case ${answer:0:1} in + y|Y ) + ${SUDO} usermod -aG sudo USERNAME + echo Done + ;; + * ) + echo Ok, continuing.... + ;; + ;; + * ) + echo Ok, continuing.... + ;; +esac \ No newline at end of file