mirror of
https://github.com/hackacad/bastille.git
synced 2026-01-03 19:23:42 +01:00
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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user