16 lines
806 B
Bash
16 lines
806 B
Bash
#!/bin/bash
|
|
echo "This script will install and configure some basic packages for RHEL-based systems."
|
|
echo "Please enter the fully qualified domain name for the server:"
|
|
read FQDN
|
|
dnf upgrade -y
|
|
dnf install epel-release -y
|
|
dnf install vim wget screen nginx certbot python3-certbot-nginx podman podman-compose htop btop tree rclone -y
|
|
systemctl enable nginx --now
|
|
certbot certonly --non-interactive --agree-tos --email=root@libre.moe --domain $FQDN --nginx
|
|
hostnamectl hostname $FQDN
|
|
mkdir -p /web/$FQDN
|
|
## TODO: Download and setup a server information page
|
|
wget -O /etc/nginx/conf.d/${FQDN%%.*}.conf https://git.libre.moe/lukas/server-setup-tools/raw/branch/main/nginx-templates/host.conf
|
|
sed -i "s/FQDN/$FQDN/g" /etc/nginx/conf.d/${FQDN%%.*}.conf
|
|
echo "Setup finished. You should now restart the server!"
|