I need to change the same file on multiple servers and replace it with the hostname of the server.
sed -i 's/localhost/myhostname/g' /var/www/config.php
Is what I currently do.
How would I turn it into a script so that it will automatically check what the servers hostname is and replace "myhostname" with the servers hostname?