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

@@ -41,21 +41,10 @@ help|-h|--help)
;;
esac
if [ $# -lt 2 ]; then
if [ $# -lt 1 ]; then
usage
fi
TARGET="${1}"
shift
if [ "${TARGET}" = 'ALL' ]; then
JAILS=$(jls name)
fi
if [ "${TARGET}" != 'ALL' ]; then
JAILS=$(jls name | awk "/^${TARGET}$/")
fi
for _jail in ${JAILS}; do
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
jexec -l "${_jail}" /usr/sbin/sysrc "$@"