From d5477b47216b3e9241d2f29b834579751192786f Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 23 Feb 2021 13:48:54 -0500 Subject: [PATCH] Add usage/help message to so-monitor-add --- salt/common/tools/sbin/so-monitor-add | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/salt/common/tools/sbin/so-monitor-add b/salt/common/tools/sbin/so-monitor-add index 8b351558f..b58cc4ee7 100644 --- a/salt/common/tools/sbin/so-monitor-add +++ b/salt/common/tools/sbin/so-monitor-add @@ -2,4 +2,22 @@ . /usr/sbin/so-common +usage() { + read -r -d '' message <<- EOM + usage: so-monitor-add [-h] NIC + + positional arguments: + NIC The interface you want to add to the monitor bond + + optional arguments: + -h, --help Show this help message and exit + EOM + echo "$message" + exit 1 +} + +if [[ $# -eq 0 || $# -gt 1 ]] || [[ $1 == '-h' || $1 == '--help' ]]; then + usage +fi + add_interface_bond0 "$1"