Ensure target is specified and exists in 1 place instead of many.

Require target to be running for commands that need it.
Closes #239.
This commit is contained in:
Chris Wells
2020-08-30 15:37:54 -04:00
parent aaffc882f9
commit c6aded8d0a
20 changed files with 162 additions and 320 deletions

View File

@@ -51,22 +51,12 @@ help|-h|--help)
;;
esac
if [ $# -lt 3 ]; then
if [ $# -ne 2 ]; then
usage
fi
TARGET="${1}"
OPTION="${2}"
VALUE="${3}"
shift
if [ "${TARGET}" = 'ALL' ]; then
JAILS=$(jls name)
fi
if [ "${TARGET}" != 'ALL' ]; then
JAILS=$(jls name | awk "/^${TARGET}$/")
fi
OPTION="${1}"
VALUE="${2}"
for _jail in ${JAILS}; do
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"