mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Updated the useage function to use printf
Using a hear doc means we have to exactly specify the formatting. Useing printf handles formatting for us
This commit is contained in:
@@ -15,21 +15,26 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
MYNAME="${0##*/}"
|
||||
|
||||
if ! [ "$(id -u)" = 0 ]; then
|
||||
echo "This command must be run as root"
|
||||
echo "${MYNAME}: This command must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
display_help() {
|
||||
cat <<HELP_USAGE
|
||||
|
||||
$0 [-h] [-q|--quiet]
|
||||
|
||||
-h Show this message.
|
||||
-q|--quiet Suppress the output and only return a
|
||||
single status code for overall status
|
||||
0:Ok, 1:Error, 2:Starting/Pending, 99:Installing SO
|
||||
HELP_USAGE
|
||||
printf "%s" "${MYNAME}"
|
||||
printf " [%s]" "-h" "-q|--quiet"
|
||||
printf "\n"
|
||||
printf "\t-%s\t%s\n" \
|
||||
"h" "Show this message." \
|
||||
"q,--quiet" "suppress the output and return a single status code of overall status"
|
||||
printf "\nReturn Codes:\n"
|
||||
printf "\t%s:%s\n" \
|
||||
"0" "Ok" \
|
||||
"1" "Error" \
|
||||
"2" "Starting/Pending"\
|
||||
"99" "Installing SO"
|
||||
}
|
||||
|
||||
# Constants
|
||||
|
||||
Reference in New Issue
Block a user