mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-22 10:10:46 +01:00
create: Allow specifying a custom config file to override default
This commit is contained in:
@@ -43,6 +43,7 @@ usage() {
|
|||||||
|
|
||||||
-B | --bridge Enables VNET, VNET containers are attached to a specified, already existing external bridge.
|
-B | --bridge Enables VNET, VNET containers are attached to a specified, already existing external bridge.
|
||||||
-C | --clone Creates a clone container, they are duplicates of the base release, consume low space and preserves changing data.
|
-C | --clone Creates a clone container, they are duplicates of the base release, consume low space and preserves changing data.
|
||||||
|
-c | --config Use a customized configuration file to override the default values.
|
||||||
-D | --dual Creates the jails with both IPv4 and IPv6 networking ('inherit' and 'ip_hostname' only).
|
-D | --dual Creates the jails with both IPv4 and IPv6 networking ('inherit' and 'ip_hostname' only).
|
||||||
-E | --empty Creates an empty container, intended for custom jail builds (thin/thick/linux or unsupported).
|
-E | --empty Creates an empty container, intended for custom jail builds (thin/thick/linux or unsupported).
|
||||||
-L | --linux This option is intended for testing with Linux jails, this is considered experimental.
|
-L | --linux This option is intended for testing with Linux jails, this is considered experimental.
|
||||||
@@ -667,6 +668,7 @@ LINUX_JAIL=""
|
|||||||
STATIC_MAC=""
|
STATIC_MAC=""
|
||||||
DUAL_STACK=""
|
DUAL_STACK=""
|
||||||
VALIDATE_RELEASE="1"
|
VALIDATE_RELEASE="1"
|
||||||
|
OPT_CONFIG=""
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
-h|--help|help)
|
-h|--help|help)
|
||||||
@@ -681,6 +683,22 @@ while [ $# -gt 0 ]; do
|
|||||||
CLONE_JAIL="1"
|
CLONE_JAIL="1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-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}"
|
||||||
|
. /usr/local/etc/bastille/${OPT_CONFIG}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
info "Using custom config: ${OPT_CONFIG}"
|
||||||
|
. "${OPT_CONFIG}"
|
||||||
|
fi
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
-D|--dual)
|
-D|--dual)
|
||||||
DUAL_STACK="1"
|
DUAL_STACK="1"
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in New Issue
Block a user