mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-23 10:40:43 +01:00
bootstrap: Allow bootstrapping with custom config
This commit is contained in:
@@ -38,7 +38,8 @@ usage() {
|
|||||||
cat << EOF
|
cat << EOF
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
-x | --debug Enable debug mode.
|
-c | --config Use a customized configuration file to override the default values.
|
||||||
|
-x | --debug Enable debug mode.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
@@ -424,6 +425,24 @@ while [ "$#" -gt 0 ]; do
|
|||||||
-h|--help|help)
|
-h|--help|help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
-c|--config)
|
||||||
|
OPT_CONFIG="${2}"
|
||||||
|
if [ ! -f "${OPT_CONFIG}" ]; then
|
||||||
|
if [ ! -f /usr/local/etc/bastille/${OPT_CONFIG} ]; then
|
||||||
|
error_notify "Not a valid config file: ${OPT_CONFIG}"
|
||||||
|
usage
|
||||||
|
else
|
||||||
|
info "Using custom config: ${OPT_CONFIG}"
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
. /usr/local/etc/bastille/${OPT_CONFIG}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
info "Using custom config: ${OPT_CONFIG}"
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
. "${OPT_CONFIG}"
|
||||||
|
fi
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
-x|--debug)
|
-x|--debug)
|
||||||
enable_debug
|
enable_debug
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in New Issue
Block a user