forked from saratov/diag-domain-client
Add error handling to test_hostnamectl
This commit is contained in:
parent
2abdafa370
commit
27e2d040ed
10
ddiag.sh
10
ddiag.sh
@ -94,10 +94,12 @@ run()
|
||||
|
||||
check_hostnamectl()
|
||||
{
|
||||
local static_host="$(hostnamectl --static)"
|
||||
local transient_host="$(hostname)"
|
||||
_command hostnamectl
|
||||
test "$static_host" = "$transient_host"
|
||||
local retval=0
|
||||
local static_host="$(hostnamectl --static)" || retval=1
|
||||
local transient_host="$(hostname)" || retval=1
|
||||
_command hostnamectl || retval=1
|
||||
test "$static_host" = "$transient_host" || retval=1
|
||||
return $retval
|
||||
}
|
||||
|
||||
test_hostname()
|
||||
|
Loading…
Reference in New Issue
Block a user