mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-16 23:31:20 +01:00
bastille: Load config only from commons.sh
Since all files source common.sh anyway, we don't want to source the config twice.
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
|
||||
PATH=${PATH}:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||
|
||||
BASTILLE_VERSION="0.13.20250126"
|
||||
|
||||
## check for config existence
|
||||
bastille_conf_check() {
|
||||
if [ ! -r "/usr/local/etc/bastille/bastille.conf" ]; then
|
||||
@@ -72,7 +74,7 @@ Bastille is an open-source system for automating deployment and management of
|
||||
containerized applications on FreeBSD.
|
||||
|
||||
Usage:
|
||||
bastille command TARGET [args]
|
||||
bastille command [option(s)] TARGET [args]
|
||||
|
||||
Available Commands:
|
||||
bootstrap Bootstrap a FreeBSD release for container base.
|
||||
@@ -113,9 +115,9 @@ Available Commands:
|
||||
verify Compare release against a "known good" index.
|
||||
zfs Manage (get|set) ZFS attributes on targeted container(s).
|
||||
|
||||
Use "bastille -v|--version" for version information.
|
||||
Use "bastille command -h|--help" for more information about a command.
|
||||
Use "bastille -c|--config command" to specify a non-defaukt config file.
|
||||
Use "bastille [-v|--version]" for version information.
|
||||
Use "bastille command [-h|--help]" for more information about a command.
|
||||
Use "bastille [-c|--config config.conf] command" to specify a non-default config file.
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
@@ -124,7 +126,6 @@ EOF
|
||||
bastille_conf_check
|
||||
bastille_perms_check
|
||||
|
||||
BASTILLE_VERSION="0.13.20250126"
|
||||
if [ -z "${BASTILLE_CONFIG}" ]; then
|
||||
BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf
|
||||
export BASTILLE_CONFIG
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille bootstrap [option(s)] [RELEASE|TEMPLATE] [update|arch]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille clone [option(s)] TARGET NEW_NAME IP_ADDRESS"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille cmd [option(s)] TARGET command"
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Load config. This only has to be done here
|
||||
# becasue all commands load this file
|
||||
# shellcheck disable=SC1090
|
||||
. ${BASTILLE_CONFIG}
|
||||
|
||||
COLOR_RED=
|
||||
COLOR_GREEN=
|
||||
COLOR_YELLOW=
|
||||
@@ -43,14 +48,6 @@ bastille_root_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
load_config() {
|
||||
# shellcheck disable=SC1090
|
||||
. ${BASTILLE_CONFIG}
|
||||
}
|
||||
|
||||
# Load configuration file
|
||||
load_config
|
||||
|
||||
enable_color() {
|
||||
. /usr/local/share/bastille/colors.pre.sh
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille config TARGET [get|set] PROPERTY_NAME NEW_VALUE"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille console [option(s)] TARGET [user]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille convert [option(s)] TARGET"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille cp [option(s)] TARGET HOST_PATH JAIL_PATH"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
# Build an independent usage for the create command
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille destroy [option(s)] [JAIL|RELEASE]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille edit [option(s)] TARGET [filename]"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille etcupdate [option(s)] [bootstrap|TARGET] [diff|resolve|update RELEASE]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
# Build an independent usage for the export command
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille htop [option(s)] TARGET"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
# Build an independent usage for the import command
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille jcp [option(s)] SOURCE_JAIL JAIL_PATH DEST_JAIL JAIL_PATH"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille limits [option(s)] TARGET OPTION VALUE"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille list [option(s)] [-j|-a] [RELEASE (-p)] [template] [JAIL|CONTAINER] [log] [limit] [import] [export] [backup]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille mount [option(s)] TARGET HOST_PATH JAIL_PATH [filesystem_type options dump pass_number]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille pkg [option(s)] TARGET COMMAND args"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille rcp [option(s)] TARGET JAIL_PATH HOST_PATH"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille rdr [option(s)] TARGET [clear|reset|list|(tcp|udp)] HOST_PORT JAIL_PORT [log ['(' logopts ')'] ]"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille rename [option(s)] TARGET NEW_NAME"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille service [options(s)] TARGET SERVICE_NAME ACTION"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_exit "Usage: bastille setup [pf|network|zfs|vnet]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille start [option(s)] TARGET"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille stop [option(s)] TARGET"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille sysrc [option(s)] TARGET args"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille tags TARGET [add|delete|list] [tag1,tag2]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille template [option(s)] TARGET [--convert|project/template]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille top [options(s)] TARGET"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille umount [option(s)] TARGET JAIL_PATH"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille update [option(s)] TARGET"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille upgrade [option(s)] TARGET [NEWRELEASE|install]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille verify [RELEASE|TEMPLATE]"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/common.sh
|
||||
load_config
|
||||
|
||||
usage() {
|
||||
error_notify "Usage: bastille zfs TARGET [set|get|snap|destroy_snap|df|usage] [key=value|date]"
|
||||
|
||||
Reference in New Issue
Block a user