Force config file in default location

This will prevent errors when bastille gathers the number of epairs on the system.
This commit is contained in:
tschettervictor
2025-04-16 16:08:17 -06:00
parent 0fe4bec89f
commit c2b756219c
5 changed files with 13 additions and 16 deletions

View File

@@ -130,8 +130,6 @@ bastille_perms_check
if [ -z "${BASTILLE_CONFIG}" ]; then
BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf
export BASTILLE_CONFIG
elif [ -r "${BASTILLE_CONFIG}" ]; then
export BASTILLE_CONFIG
elif [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then
BASTILLE_CONFIG="/usr/local/etc/bastille/${BASTILLE_CONFIG}"
export BASTILLE_CONFIG
@@ -155,10 +153,7 @@ while [ "$#" -gt 0 ]; do
;;
-c|--config)
BASTILLE_CONFIG="${2}"
if [ -r "${BASTILLE_CONFIG}" ]; then
info "Using custom config: ${BASTILLE_CONFIG}"
export BASTILLE_CONFIG
elif [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then
if [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then
BASTILLE_CONFIG="/usr/local/etc/bastille/${BASTILLE_CONFIG}"
info "Using custom config: ${BASTILLE_CONFIG}"
export BASTILLE_CONFIG