From b5fb31139b18385f295debe8acdb25c23b6f8b87 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Thu, 5 Oct 2017 12:30:03 -0400
Subject: [PATCH 1/9] WRS: Patch4-support-interface-scriptlets.patch

---
 sysconfig/network-scripts/ifdown      |  6 ++++++
 sysconfig/network-scripts/ifdown-post | 12 ++++++++++++
 sysconfig/network-scripts/ifup        |  6 ++++++
 sysconfig/network-scripts/ifup-post   | 12 ++++++++++++
 4 files changed, 36 insertions(+)

diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 90b1c83..88c1d74 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -58,6 +58,12 @@ if [ -x /sbin/ifdown-pre-local ]; then
     /sbin/ifdown-pre-local ${DEVICE}
 fi
 
+# WRS: Execute pre-down commands.
+if [ -n "$pre_down" ]; then
+    eval $pre_down
+    [ "$?" != "0" ] && exit 1
+fi
+
 OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}"
 
 if [ ! -x ${OTHERSCRIPT} ]; then
diff --git a/sysconfig/network-scripts/ifdown-post b/sysconfig/network-scripts/ifdown-post
index 8b56e14..bd4198a 100755
--- a/sysconfig/network-scripts/ifdown-post
+++ b/sysconfig/network-scripts/ifdown-post
@@ -69,4 +69,16 @@ if [ -x /sbin/ifdown-local ]; then
     /sbin/ifdown-local ${DEVICE}
 fi
 
+# WRS: Execute down commands.
+if [ -n "$down" ]; then
+    eval $down
+    [ "$?" != "0" ] && exit 1
+fi
+
+# WRS: Execute post-down commands.
+if [ -n "$post_down" ]; then
+    eval $post_down
+    [ "$?" != "0" ] && exit 1
+fi
+
 exit 0
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index d25db5a..07c63a5 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -151,6 +151,12 @@ if [ -x /sbin/ifup-pre-local ]; then
     /sbin/ifup-pre-local ${CONFIG} $2
 fi
 
+# WRS: Execute pre-up commands.
+if [ -n "$pre_up" ]; then
+    eval $pre_up
+    [ "$?" != "0" ] && exit 1
+fi
+
 OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-${DEVICETYPE}"
 
 if [ ! -x ${OTHERSCRIPT} ]; then
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post
index ab0710b..3b76492 100755
--- a/sysconfig/network-scripts/ifup-post
+++ b/sysconfig/network-scripts/ifup-post
@@ -148,4 +148,16 @@ if [ -x /sbin/ifup-local ]; then
     /sbin/ifup-local ${DEVICE}
 fi
 
+# WRS: Execute up commands.
+if [ -n "$up" ]; then
+    eval $up
+    [ "$?" != "0" ] && exit 1
+fi
+
+# WRS: Execute post-up commands.
+if [ -n "$post_up" ]; then
+    eval $post_up
+    [ "$?" != "0" ] && exit 1
+fi
+
 exit 0
-- 
1.9.1

