Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-cloud / recipes-support / cluster-resource-agents / resource-agents / stx / ipaddr2_check_if_state.patch
1 From fb5a76d9050c60b601a5dbbad65ed3dbff041af1 Mon Sep 17 00:00:00 2001
2 From: Scott Little <scott.little@windriver.com>
3 Date: Mon, 2 Oct 2017 15:12:36 -0400
4 Subject: [PATCH 03/13] WRS: Patch1107: ipaddr2_check_if_state.patch
5
6 ---
7  heartbeat/IPaddr2 | 21 ++++++++++++++++++---
8  1 file changed, 18 insertions(+), 3 deletions(-)
9
10 diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
11 index aef6dc7..67a7ca3 100755
12 --- a/heartbeat/IPaddr2
13 +++ b/heartbeat/IPaddr2
14 @@ -964,7 +964,12 @@ ip_start() {
15         local ip_status=`ip_served`
16  
17         if [ "$ip_status" = "ok" ]; then
18 -               exit $OCF_SUCCESS
19 +               if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
20 +               then
21 +                       exit $OCF_SUCCESS
22 +               else
23 +                       exit $OCF_ERR_GENERIC
24 +               fi
25         fi
26         
27         if [ -n "$IP_CIP" ] && ([ $ip_status = "no" ] || [ $ip_status = "partial2" ]); then
28 @@ -1023,7 +1028,12 @@ ip_start() {
29                 fi
30                 ;;
31         esac
32 -       exit $OCF_SUCCESS
33 +       if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
34 +       then
35 +               exit $OCF_SUCCESS
36 +       else
37 +               exit $OCF_ERR_GENERIC
38 +       fi
39  }
40  
41  ip_stop() {
42 @@ -1099,7 +1109,12 @@ ip_monitor() {
43         case $ip_status in
44         ok)
45                 run_arp_sender refresh
46 -               return $OCF_SUCCESS
47 +               if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
48 +               then
49 +                       return $OCF_SUCCESS
50 +               else
51 +                       return $OCF_NOT_RUNNING
52 +               fi
53                 ;;
54         partial|no|partial2)
55                 exit $OCF_NOT_RUNNING
56 -- 
57 1.9.1
58