forked from saratov/diag-domain-client
Add -r parameter for _command function
This commit is contained in:
parent
0b76600565
commit
022b96c71d
9
ddiag.sh
9
ddiag.sh
@ -32,11 +32,16 @@ _command()
|
||||
{
|
||||
local retval=0
|
||||
local x=
|
||||
local p='$'
|
||||
if test "$1" = '-x'; then
|
||||
shift
|
||||
x=1
|
||||
fi
|
||||
color_message "\$ $*" bold
|
||||
if test "$1" = '-r'; then
|
||||
shift
|
||||
p='#'
|
||||
fi
|
||||
color_message "$p $*" bold
|
||||
test -z "$x" || echo -------------------------------------------------------------------------------
|
||||
$* || retval=$?
|
||||
test -z "$x" || echo -------------------------------------------------------------------------------
|
||||
@ -59,7 +64,7 @@ run_by_root()
|
||||
else
|
||||
test -z "$msg" ||
|
||||
echo -n "$msg: "
|
||||
_command $* || return 1
|
||||
_command -r $* || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user