more fixed stuff

This commit is contained in:
Fr4nz D13trich 2025-10-10 20:38:19 +02:00
parent de000d134e
commit c031baf491

View file

@ -64,18 +64,18 @@ while true; do
done
ip4=$(/sbin/ip -o -4 addr list "$nif" | awk '{print $4}' | cut -d/ -f1) ### GET IP FOR CHOSEN INTERFACE ########## HOSTNAME TROUBLE! fix it
echo -e "\n ${YEL}Current hostname : ${LCY}$HOSTNAME${CRS}"
echo -e "\n ${YEL}Current hostname : ${LCY}$(hostname)${CRS}"
echo -e " ${YEL}Current ip address : ${LCY}$ip4 ${YEL}@ ${LCY}$nif${CRS}"
echo -e "\n ${YEL}This information will be used to configure ${LCY}nginx.conf ${YEL}during the next steps.${CRS}"
while true; do
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname
if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then
new_hostname=$HOSTNAME
new_hostname=$(hostname)
break
elif [[ "$conf_hostname" = "y" || "$conf_hostname" = "Y" ]]; then
read -p " Enter new hostname --> " new_hostname
sudo sed -i.backup "s/$HOSTNAME/$new_hostname/g" /etc/hosts
sudo sed -i.backup "s/$(hostname)/$new_hostname/g" /etc/hosts
sudo echo "$new_hostname" > /etc/hostname
sudo systemctl restart NetworkManager
hostname -F /etc/hostname
@ -115,11 +115,11 @@ while true; do
echo -e "\n ${GRN}SSL certificate files ${LCY}$cert_name.crt ${GRN}and ${LCY}$cert_name.key ${GRN}created and stored in ${LCY}$cert_path${CRS}\n"
sudo chmod 644 "$cert_path"/"$cert_name".crt
sudo chmod 600 "$cert_path"/"$cert_name".key
sudo cp assets/config/nginx/nginx_SSL.conf /etc/nginx/sites-enabled/$HOSTNAME.conf
sudo sed -i.backup "s/DOMAIN/$HOSTNAME.local/g" /etc/nginx/sites-enabled/$HOSTNAME.conf
sudo sed -i "s/IPADDR/$ip4/g" /etc/nginx/sites-enabled/$HOSTNAME.conf
sudo sed -i "s|CERTPATH|$cert_path/$cert_name|" /etc/nginx/sites-enabled/$HOSTNAME.conf
sudo sed -i "s|KEYPATH|$cert_path/$cert_name|" /etc/nginx/sites-enabled/$HOSTNAME.conf
sudo cp assets/config/nginx/nginx_SSL.conf /etc/nginx/sites-enabled/$(hostname).conf
sudo sed -i.backup "s/DOMAIN/$(hostname).local/g" /etc/nginx/sites-enabled/$(hostname).conf
sudo sed -i "s/IPADDR/$ip4/g" /etc/nginx/sites-enabled/$(hostname).conf
sudo sed -i "s|CERTPATH|$cert_path/$cert_name|" /etc/nginx/sites-enabled/$(hostname).conf
sudo sed -i "s|KEYPATH|$cert_path/$cert_name|" /etc/nginx/sites-enabled/$(hostname).conf
break
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
echo -e "\n ${RED}Encryption disabled${CRS}\n"