more fixed stuff
This commit is contained in:
parent
de000d134e
commit
c031baf491
1 changed files with 8 additions and 8 deletions
|
|
@ -64,18 +64,18 @@ while true; do
|
||||||
done
|
done
|
||||||
|
|
||||||
ip4=$(/sbin/ip -o -4 addr list "$nif" | awk '{print $4}' | cut -d/ -f1) ### GET IP FOR CHOSEN INTERFACE ########## HOSTNAME TROUBLE! fix it
|
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 " ${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}"
|
echo -e "\n ${YEL}This information will be used to configure ${LCY}nginx.conf ${YEL}during the next steps.${CRS}"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname
|
read -p " Would you like to change the hostname? (y/N) --> " conf_hostname
|
||||||
if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then
|
if [[ "$conf_hostname" = "" || "$conf_hostname" = "n" || "$conf_hostname" = "N" ]]; then
|
||||||
new_hostname=$HOSTNAME
|
new_hostname=$(hostname)
|
||||||
break
|
break
|
||||||
elif [[ "$conf_hostname" = "y" || "$conf_hostname" = "Y" ]]; then
|
elif [[ "$conf_hostname" = "y" || "$conf_hostname" = "Y" ]]; then
|
||||||
read -p " Enter new hostname --> " new_hostname
|
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 echo "$new_hostname" > /etc/hostname
|
||||||
sudo systemctl restart NetworkManager
|
sudo systemctl restart NetworkManager
|
||||||
hostname -F /etc/hostname
|
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"
|
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 644 "$cert_path"/"$cert_name".crt
|
||||||
sudo chmod 600 "$cert_path"/"$cert_name".key
|
sudo chmod 600 "$cert_path"/"$cert_name".key
|
||||||
sudo cp assets/config/nginx/nginx_SSL.conf /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.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/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|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 sed -i "s|KEYPATH|$cert_path/$cert_name|" /etc/nginx/sites-enabled/$(hostname).conf
|
||||||
break
|
break
|
||||||
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
|
elif [[ "$installSSL" == "n" || "$installSSL" = "N" ]]; then
|
||||||
echo -e "\n ${RED}Encryption disabled${CRS}\n"
|
echo -e "\n ${RED}Encryption disabled${CRS}\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue