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
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
MYNAME="${0##*/}"
|
||||||
|
|
||||||
if ! [ "$(id -u)" = 0 ]; then
|
if ! [ "$(id -u)" = 0 ]; then
|
||||||
echo "This command must be run as root"
|
echo "${MYNAME}: This command must be run as root"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
display_help() {
|
display_help() {
|
||||||
cat <<HELP_USAGE
|
printf "%s" "${MYNAME}"
|
||||||
|
printf " [%s]" "-h" "-q|--quiet"
|
||||||
$0 [-h] [-q|--quiet]
|
printf "\n"
|
||||||
|
printf "\t-%s\t%s\n" \
|
||||||
-h Show this message.
|
"h" "Show this message." \
|
||||||
-q|--quiet Suppress the output and only return a
|
"q,--quiet" "suppress the output and return a single status code of overall status"
|
||||||
single status code for overall status
|
printf "\nReturn Codes:\n"
|
||||||
0:Ok, 1:Error, 2:Starting/Pending, 99:Installing SO
|
printf "\t%s:%s\n" \
|
||||||
HELP_USAGE
|
"0" "Ok" \
|
||||||
|
"1" "Error" \
|
||||||
|
"2" "Starting/Pending"\
|
||||||
|
"99" "Installing SO"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
|
|||||||
Reference in New Issue
Block a user