diff options
author | jonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e> | 2006-10-14 10:57:42 +0000 |
---|---|---|
committer | jonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e> | 2006-10-14 10:57:42 +0000 |
commit | bd1971c6a02fec5a2ff02314c893aa0b3519aa38 (patch) | |
tree | 0b0e75ef16f7a7b333e7f438475b245353ac4369 /common-settings | |
parent | 45c6726bd3510ac54bf32a6d08bf2ed24c78b479 (diff) |
Move host and target configs to subdirs. Allow either using a shared config or override with a custom one. Don't exit 0 in common-settings.
git-svn-id: svn+ssh://xayide/home/jonas/private_svn/fleshybrid/homebase@37 8f53b18a-e215-0410-8885-9f593d34873e
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 |