Hacker News new | ask | show | jobs
by mcpherrinm 5165 days ago
I have a "~/.hostclass" file on all systems, created manually, which contains some string identifying which confiv variant to use on that machine. EG, "home", "work".

Then, my config files are "make"'d by concatting three files: cat "$1.first" "$1.`cat ~/.hostclass`" "$1.end" > ~/.$1

This lets me split out specific parts into a hostclass-specific file.

Generally, I set variables in these files that gets used in the $1.end file.

It works pretty well for me, since my hosts are generally pretty close to each other.