diff options
| author | luwenpeng <[email protected]> | 2022-03-14 11:14:08 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2022-03-14 11:14:08 +0800 |
| commit | 5f6f5e7c510098107bbd1adcd0a17a59cfcfb91b (patch) | |
| tree | d9bde8817485617254a3ce3beca45f3eb37185c7 | |
| parent | db4ab84e0d90991a0d247eba81d1d97165b319d3 (diff) | |
修改onie-netcfg-net的提示信息v2.0.2-20220314
| -rwxr-xr-x | rootconf/default/bin/onie-netcfg-set | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/rootconf/default/bin/onie-netcfg-set b/rootconf/default/bin/onie-netcfg-set index 243a1ae7..847cdcbe 100755 --- a/rootconf/default/bin/onie-netcfg-set +++ b/rootconf/default/bin/onie-netcfg-set @@ -1,7 +1,9 @@ #!/bin/sh function usage() { - echo "$(basename $0) interface address netmask [gateway]" + echo "" + echo "Usage: $(basename $0) interface address netmask [gateway]" + echo "" cat <<EOF Configuring the IPv4 Network of the ONIE Management Port. @@ -49,7 +51,6 @@ function check_cmd_args() { check_interface $interface ret=$? if [ "$ret" == 1 ]; then - usage exit 1 fi @@ -97,10 +98,14 @@ address=$2 netmask=$3 gateway=$4 +if [ -z "$interface" ] || [ -z "$address" ] || [ -z "$netmask" ]; then + usage + exit 1 +fi + check_cmd_args $interface $address $netmask $gateway ret=$? if [ "$ret" == 1 ]; then - usage exit 1 fi |
