aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
authorMichael K. Johnson <johnsonm@redhat.com>1997-09-18 19:49:46 +0000
committerMichael K. Johnson <johnsonm@redhat.com>1997-09-18 19:49:46 +0000
commitb49499f63193f2e1be55badd92b0c7ed203e8dc7 (patch)
treeaf452ce5d2aa3fbeef0dca5cba6fdfa906376196 /sysconfig/network-scripts/network-functions
parent474a704b1a42ce6d44a79b6dacf06d9ba2b780ad (diff)
downloadinitscripts-b49499f63193f2e1be55badd92b0c7ed203e8dc7.tar
initscripts-b49499f63193f2e1be55badd92b0c7ed203e8dc7.tar.gz
initscripts-b49499f63193f2e1be55badd92b0c7ed203e8dc7.tar.bz2
initscripts-b49499f63193f2e1be55badd92b0c7ed203e8dc7.tar.xz
initscripts-b49499f63193f2e1be55badd92b0c7ed203e8dc7.zip
Support alternative device configurations.
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions18
1 files changed, 18 insertions, 0 deletions
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
+}