diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index f5afeda9..5f6fab92 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -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 diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index c7d97dbc..d4336da8 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -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]" diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 74a88b78..64eb0d23 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -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" diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index cca0082e..21fe6722 100644 --- a/usr/local/share/bastille/cmd.sh +++ b/usr/local/share/bastille/cmd.sh @@ -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" diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index 262e6ecf..9cec63f9 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -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 } diff --git a/usr/local/share/bastille/config.sh b/usr/local/share/bastille/config.sh index 0323d470..b15a03fb 100644 --- a/usr/local/share/bastille/config.sh +++ b/usr/local/share/bastille/config.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" diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index 7b133287..cc66da6d 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -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]" diff --git a/usr/local/share/bastille/convert.sh b/usr/local/share/bastille/convert.sh index 8b6d66fe..b7659638 100644 --- a/usr/local/share/bastille/convert.sh +++ b/usr/local/share/bastille/convert.sh @@ -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" diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index c23a17e7..314cb239 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -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" diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 2f3783a5..cbea793b 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -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 diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index d590adf1..6c7902d7 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -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]" diff --git a/usr/local/share/bastille/edit.sh b/usr/local/share/bastille/edit.sh index 0298da89..03ab215e 100644 --- a/usr/local/share/bastille/edit.sh +++ b/usr/local/share/bastille/edit.sh @@ -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]" diff --git a/usr/local/share/bastille/etcupdate.sh b/usr/local/share/bastille/etcupdate.sh index 4db33e7b..b3f08cbe 100644 --- a/usr/local/share/bastille/etcupdate.sh +++ b/usr/local/share/bastille/etcupdate.sh @@ -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]" diff --git a/usr/local/share/bastille/export.sh b/usr/local/share/bastille/export.sh index 584f1e36..d1274798 100644 --- a/usr/local/share/bastille/export.sh +++ b/usr/local/share/bastille/export.sh @@ -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 diff --git a/usr/local/share/bastille/htop.sh b/usr/local/share/bastille/htop.sh index 1e0f796e..fe2607d0 100644 --- a/usr/local/share/bastille/htop.sh +++ b/usr/local/share/bastille/htop.sh @@ -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" diff --git a/usr/local/share/bastille/import.sh b/usr/local/share/bastille/import.sh index ec55fbd4..15e4677a 100644 --- a/usr/local/share/bastille/import.sh +++ b/usr/local/share/bastille/import.sh @@ -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 diff --git a/usr/local/share/bastille/jcp.sh b/usr/local/share/bastille/jcp.sh index ac2aa490..391511cf 100644 --- a/usr/local/share/bastille/jcp.sh +++ b/usr/local/share/bastille/jcp.sh @@ -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" diff --git a/usr/local/share/bastille/limits.sh b/usr/local/share/bastille/limits.sh index b20b2a12..2d511987 100644 --- a/usr/local/share/bastille/limits.sh +++ b/usr/local/share/bastille/limits.sh @@ -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" diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index 3fd0dec5..01baf641 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -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]" diff --git a/usr/local/share/bastille/mount.sh b/usr/local/share/bastille/mount.sh index dd0e7bc0..d58664fe 100644 --- a/usr/local/share/bastille/mount.sh +++ b/usr/local/share/bastille/mount.sh @@ -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]" diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index fe4a000e..c51b9ea4 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -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" diff --git a/usr/local/share/bastille/rcp.sh b/usr/local/share/bastille/rcp.sh index 0c82b299..b6273ae7 100644 --- a/usr/local/share/bastille/rcp.sh +++ b/usr/local/share/bastille/rcp.sh @@ -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" diff --git a/usr/local/share/bastille/rdr.sh b/usr/local/share/bastille/rdr.sh index bc9c26b7..8edfe474 100644 --- a/usr/local/share/bastille/rdr.sh +++ b/usr/local/share/bastille/rdr.sh @@ -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 ')'] ]" diff --git a/usr/local/share/bastille/rename.sh b/usr/local/share/bastille/rename.sh index 41600f75..00a2e541 100644 --- a/usr/local/share/bastille/rename.sh +++ b/usr/local/share/bastille/rename.sh @@ -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" diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index 1bb7fc27..40551def 100644 --- a/usr/local/share/bastille/service.sh +++ b/usr/local/share/bastille/service.sh @@ -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" diff --git a/usr/local/share/bastille/setup.sh b/usr/local/share/bastille/setup.sh index 726c08f8..71b9d1c0 100644 --- a/usr/local/share/bastille/setup.sh +++ b/usr/local/share/bastille/setup.sh @@ -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]" diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index 923b338b..bdb2cc91 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -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" diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 0a921baf..8e8a1f2a 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -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" diff --git a/usr/local/share/bastille/sysrc.sh b/usr/local/share/bastille/sysrc.sh index 3b5bbb19..de715e13 100644 --- a/usr/local/share/bastille/sysrc.sh +++ b/usr/local/share/bastille/sysrc.sh @@ -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" diff --git a/usr/local/share/bastille/tags.sh b/usr/local/share/bastille/tags.sh index 3bba6941..be0fc13a 100644 --- a/usr/local/share/bastille/tags.sh +++ b/usr/local/share/bastille/tags.sh @@ -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]" diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 5c4de5ee..f8cad31e 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -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]" diff --git a/usr/local/share/bastille/top.sh b/usr/local/share/bastille/top.sh index 3883b126..9c767079 100644 --- a/usr/local/share/bastille/top.sh +++ b/usr/local/share/bastille/top.sh @@ -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" diff --git a/usr/local/share/bastille/umount.sh b/usr/local/share/bastille/umount.sh index 36a147cc..57c3081c 100644 --- a/usr/local/share/bastille/umount.sh +++ b/usr/local/share/bastille/umount.sh @@ -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" diff --git a/usr/local/share/bastille/update.sh b/usr/local/share/bastille/update.sh index a5665b78..ba3ea52f 100644 --- a/usr/local/share/bastille/update.sh +++ b/usr/local/share/bastille/update.sh @@ -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" diff --git a/usr/local/share/bastille/upgrade.sh b/usr/local/share/bastille/upgrade.sh index eb2b7e0a..45088490 100644 --- a/usr/local/share/bastille/upgrade.sh +++ b/usr/local/share/bastille/upgrade.sh @@ -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]" diff --git a/usr/local/share/bastille/verify.sh b/usr/local/share/bastille/verify.sh index 7309883d..f1983902 100644 --- a/usr/local/share/bastille/verify.sh +++ b/usr/local/share/bastille/verify.sh @@ -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]" diff --git a/usr/local/share/bastille/zfs.sh b/usr/local/share/bastille/zfs.sh index 8d1e6cc2..675cb0e1 100644 --- a/usr/local/share/bastille/zfs.sh +++ b/usr/local/share/bastille/zfs.sh @@ -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]"