summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Čajka <jcajka@redhat.com>2020-05-20 13:31:29 +0000
committerDan Horák <dan@danny.cz>2020-06-01 10:20:44 +0200
commit7a2058ebc60661b11863da9c2dc1c75a17af7c7f (patch)
tree84c062b3244b982260b2b096b2e9a2f149963b4e
parentce2f8704cfdfd6afae71dc9bf089acbaac599959 (diff)
downloadutils-7a2058ebc60661b11863da9c2dc1c75a17af7c7f.tar.gz
utils-7a2058ebc60661b11863da9c2dc1c75a17af7c7f.tar.xz
utils-7a2058ebc60661b11863da9c2dc1c75a17af7c7f.zip
- avoid dependency on network-scrips
-rw-r--r--ccw_init13
1 files changed, 11 insertions, 2 deletions
diff --git a/ccw_init b/ccw_init
index a691ae0..23e8ed9 100644
--- a/ccw_init
+++ b/ccw_init
@@ -24,6 +24,17 @@ get_config_line_by_subchannel()
return 1
}
+# borrowed from network-scrips, initscripts along with the get_config_by_subchannel
+[ -z "$__sed_discard_ignored_files" ] && __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
+
+get_config_by_subchannel ()
+{
+ LANG=C grep -E -i -l \
+ "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \
+ /etc/sysconfig/network-scripts/ifcfg-* \
+ | LC_ALL=C sed -e "$__sed_discard_ignored_files"
+}
+
CHANNEL=${DEVPATH##*/}
if [ $MODE = "dracut" ]; then
@@ -49,8 +60,6 @@ if [ $MODE = "dracut" ]; then
elif [ $MODE = "normal" ]; then
NOLOCALE="yes"
- . /etc/sysconfig/network-scripts/network-functions
-
CONFIG_FILE=$(get_config_by_subchannel $CHANNEL)
if [ -n "$CONFIG_FILE" ]; then