On Mon, Dec 21, 2020 at 04:05:11PM +0800, Ren Wen wrote:
On Mon, Dec 21, 2020 at 03:37:15PM +0800, Zhang Yu wrote:
[why] if /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0 both not exit, the
spell: exit -> exist
value of return should be 0 not 1
In shell, 0 always means success. Is this what you want?
Yes, this is what i want
Thanks, RenWen
Signed-off-by: Zhang Yu 2134782174@qq.com
tests/host-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/host-info b/tests/host-info index 3984727b4..fe55d1ff2 100755 --- a/tests/host-info +++ b/tests/host-info @@ -102,7 +102,7 @@ get_ipmi_ip() # 802.1q VLAN ID : Disabled # RMCP+ Cipher Suites : 0,1,2,3,17 # Cipher Suite Priv Max : XuuaXXXXXXXXXXX
- [ -e /dev/ipmi0 ] || [ -e /dev/ipmi/0 ] || [ -e /dev/ipmidev/0 ] || return
- [ -e /dev/ipmi0 ] || [ -e /dev/ipmi/0 ] || [ -e /dev/ipmidev/0 ] || return 0 local ip=$(ipmitool lan print | awk 'NR==3{print $4}') [ -n "$ip" ] && echo "ipmi_ip: $ip"
}
2.23.0