aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
blob: f637c7eed7d7e6ab8e7c771e50d6ecd90cf6ff53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}