I have to write a shell script to install multiple services dynamically. I don´t know too much about shell scripting or the unix shell general, so I really need some help. This is my shell file.
#!/bin/bash
# Ask the user for their name
echo What is the name of your domain?
read varname
echo You passed the domain name to your domain $varname successfully
This is my nginx.conf file.
server {
listen 80;
server_name $varname;
rewrite ^(.*) https://$server_name$1 permanent;
}
I want to pass varname to the nginx.conf file to set the server name based on the users input. How can I do this?