I'm running several LEMP VMs with mostly identical setups. Each of these VMs has a /etc/profile.d/00-aliases.sh
containing a bunch of aliasses and functions to run on the server.
Now, whenever I make a change to those aliasses/functions I have to manually copy/paste the file to the other servers.
I want to load the file from an external source every time I log in via SSH. I've seen this behaviour on other servers with a "Loading external scripts.." prompt on login. On top of that it would need some kind of local variables for the functions and some variables because there are slight variations in themes and foldernames on each server.
So best case scenario I'd have something like this for the variables (pseudocode):
var sitename = SiteA
var sitepath = /html/path/
and then one global bash.rc/aliasses file like this:
alias goroot = 'cd {sitepath}'
alias delses = 'rm -rf /var/session/'
...
Is this possible (with the variables), if yes, how? Where do I start to look?