Allow running bastille and subcomands with help flags as regular user

This commit is contained in:
Lars Engels
2023-03-16 20:58:11 +01:00
parent 6776427e5a
commit 64c3b6045e
33 changed files with 74 additions and 14 deletions

View File

@@ -35,6 +35,12 @@ usage() {
error_exit "Usage: bastille list [-j|-a] [release [-p]|template|(jail|container)|log|limit|(import|export|backup)]"
}
if [ "$1" = help -o "$1" = "-h" -o "$1" = "--help" ]; then
usage
fi
bastille_root_check
if [ $# -eq 0 ]; then
/usr/sbin/jls -N
fi
@@ -47,9 +53,6 @@ fi
if [ $# -gt 0 ]; then
# Handle special-case commands first.
case "$1" in
help|-h|--help)
usage
;;
all|-a|--all)
if [ -d "${bastille_jailsdir}" ]; then
DEFAULT_VALUE="-"