Small cosmetic/typo corrections

This commit is contained in:
Jose
2021-01-10 02:26:40 -04:00
parent ed8ff8bd80
commit 6aa84cb3f5
2 changed files with 8 additions and 8 deletions

View File

@@ -50,24 +50,24 @@ TARGET="${1}"
# Gather bastille list info(sysrc targets /etc/rc.conf by default). # Gather bastille list info(sysrc targets /etc/rc.conf by default).
# Default bastille rc vars are bastille_enable and bastille_list. # Default bastille rc vars are bastille_enable and bastille_list.
BASTILLE_DISABLE_STAT=$(sysrc -qn bastille_enable) BASTILLE_LIST_CURRENT=$(sysrc -qn bastille_list)
BASILLE_LIST_CURRENT=$(sysrc -qn bastille_list)
BASTILLE_LIST_TARGET=$(sysrc -qn bastille_list | tr -s " " "\n" | awk "/^${TARGET}$/") BASTILLE_LIST_TARGET=$(sysrc -qn bastille_list | tr -s " " "\n" | awk "/^${TARGET}$/")
bastille_disable_check(){ bastille_disable_check(){
# Check bastille disable status. # Check bastille disable status.
if [ "${BASTILLE_DISABLE_STAT}" != "NO" ]; then BASTILLE_ENABLE_STAT=$(sysrc -qn bastille_enable)
if [ "${BASTILLE_ENABLE_STAT}" != "NO" ]; then
sysrc bastille_enable="NO" sysrc bastille_enable="NO"
fi fi
} }
if [ "${TARGET}" = 'ALL' ]; then if [ "${TARGET}" = 'ALL' ]; then
if [ -n "${BASILLE_LIST_CURRENT}" ]; then if [ -n "${BASTILLE_LIST_CURRENT}" ]; then
# Clear current startup list. # Clear current startup list.
info "Disabling all jails..." info "Disabling all jails..."
sysrc bastille_list= sysrc bastille_list=
info "All jails disabled." info "All jails disabled."
elif [ -z "${BASILLE_LIST_CURRENT}" ]; then elif [ -z "${BASTILLE_LIST_CURRENT}" ]; then
error_exit "All jails already disabled." error_exit "All jails already disabled."
fi fi
bastille_disable_check bastille_disable_check

View File

@@ -50,19 +50,19 @@ TARGET="${1}"
# Gather bastille list info(sysrc targets /etc/rc.conf by default). # Gather bastille list info(sysrc targets /etc/rc.conf by default).
# Default bastille rc vars are bastille_enable and bastille_list. # Default bastille rc vars are bastille_enable and bastille_list.
BASTILLE_ENABLE_STAT=$(sysrc -qn bastille_enable) BASTILLE_LIST_CURRENT=$(sysrc -qn bastille_list)
BASILLE_LIST_CURRENT=$(sysrc -qn bastille_list)
BASTILLE_LIST_TARGET=$(sysrc -qn bastille_list | tr -s " " "\n" | awk "/^${TARGET}$/") BASTILLE_LIST_TARGET=$(sysrc -qn bastille_list | tr -s " " "\n" | awk "/^${TARGET}$/")
bastille_enable_check(){ bastille_enable_check(){
# Check bastille enable status. # Check bastille enable status.
BASTILLE_ENABLE_STAT=$(sysrc -qn bastille_enable)
if [ "${BASTILLE_ENABLE_STAT}" != "YES" ]; then if [ "${BASTILLE_ENABLE_STAT}" != "YES" ]; then
sysrc bastille_enable="YES" sysrc bastille_enable="YES"
fi fi
} }
if [ "${TARGET}" = 'ALL' ]; then if [ "${TARGET}" = 'ALL' ]; then
if [ -n "${BASILLE_LIST_CURRENT}" ]; then if [ -n "${BASTILLE_LIST_CURRENT}" ]; then
# Clear current list to re-apply default jail startup list. # Clear current list to re-apply default jail startup list.
info "Clearing current startup list..." info "Clearing current startup list..."
sysrc bastille_list= sysrc bastille_list=