diff options
Diffstat (limited to 'common-settings')
-rw-r--r-- | common-settings | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/common-settings b/common-settings index 84d49d1..b39952a 100644 --- a/common-settings +++ b/common-settings @@ -5,8 +5,33 @@ set -e . ./defaults.cfg || exit 1 -. ./host.cfg || exit 1 -. ./target.cfg || exit 1 -. ./defaults-aftermath.cfg || exit 1 -exit 0 +shareddir="hosts" +sharedfile="host" +customfile="host.cfg" +if [ -f "$customfile" ]; then + if [ -f "$sharedfile" ]; then + echo "W: Ignoring shared host config \"$sharedfile\" - using custom \"$customfile\" instead." + fi + . "$customfile" +elif [ -f "$sharedfile" ]; then + . "$shareddir"/`cat "$sharedfile" |head -1` +else + echo "E: No host config found - either mention shared host config in \"$sharedfile\" or write custom file \"$customfile\"." +fi + +shareddir="targets" +sharedfile="target" +customfile="target.cfg" +if [ -f "$customfile" ]; then + if [ -f "$sharedfile" ]; then + echo "W: Ignoring shared target config \"$sharedfile\" - using custom \"$customfile\" instead." + fi + . "$customfile" +elif [ -f "$sharedfile" ]; then + . "$shareddir"/`cat "$sharedfile" |head -1` +else + echo "E: No target config found - either mention shared host config in \"$sharedfile\" or write custom file \"$customfile\"." +fi + +. ./defaults-aftermath.cfg || exit 1 |