From bd1971c6a02fec5a2ff02314c893aa0b3519aa38 Mon Sep 17 00:00:00 2001 From: jonas Date: Sat, 14 Oct 2006 10:57:42 +0000 Subject: 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 --- common-settings | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'common-settings') 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 -- cgit v1.2.3