From b49499f63193f2e1be55badd92b0c7ed203e8dc7 Mon Sep 17 00:00:00 2001 From: "Michael K. Johnson" Date: Thu, 18 Sep 1997 19:49:46 +0000 Subject: Support alternative device configurations. --- sysconfig/network-scripts/network-functions | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sysconfig/network-scripts/network-functions (limited to 'sysconfig/network-scripts/network-functions') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions new file mode 100644 index 00000000..f637c7ee --- /dev/null +++ b/sysconfig/network-scripts/network-functions @@ -0,0 +1,18 @@ +# This is not a shell script; it provides functions to network scripts +# that source it. + +source_config () +{ + DEVNAME=`echo $CONFIG | sed 's/^ifcfg-//g'` + + . $CONFIG + if echo $CONFIG | grep -q '[^g]-' ; then + PARENTCONFIG=`echo $CONFIG | sed 's/-[^-]*$//g'` + PARENTDEVNAME=`echo $PARENTCONFIG | sed 's/^ifcfg-//g'` + [ -f $PARENTCONFIG ] || { + echo "Missing config file $PARENTCONFIG." >&2 + exit 1 + } + . $PARENTCONFIG + fi +} -- cgit v1.2.1