diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index 2786a550..de5cd337 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -34,7 +34,7 @@ SAVED_TERM=$TERM . /usr/local/etc/bastille/bastille.conf ## version -BASTILLE_VERSION="0.3.20181112" +BASTILLE_VERSION="0.3.20181114" usage() { @@ -93,20 +93,10 @@ case "${CMD}" in cmd|cp|create|destroy|list|pkg|restart|start|stop|sysrc|template|verify) ;; update|upgrade) - CMD_ENV="${CMD_ENV} PAGER=cat" ;; console|bootstrap|htop|top) ;; bootstrap|update|upgrade) - while read envvar envvalue; do - case "${envvar}" in - FETCH_BIND_ADDRESS|FTP_*|ftp_*|HTTP_*|http_*|SSL_|NO_PROXY|no_proxy|MAKEOBJDIRPREFIX) - CMD_ENV="${CMD_ENV} ${envvar}=${envvalue}" - ;; - esac - done <<-EOF - $(env | sed -Ee 's,^([^=]*)=(.*),\1 \2,') - EOF ;; *) usage @@ -121,4 +111,4 @@ umask ${UMASK} : ${SH:=sh} -exec env -i ${CMD_ENV} ${SH} "${SCRIPTPATH}" "$@" +exec ${SH} "${SCRIPTPATH}" "$@" diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index 4b8ed02b..0c8afd43 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -110,22 +110,22 @@ case "${RELEASE}" in ;; 12.0-BETA1) bootstrap - echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}" + echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}" ;; 12.0-BETA2) bootstrap - echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}" + echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}" ;; 12.0-BETA3) bootstrap - echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}" + echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}" ;; 12.0-BETA4) bootstrap - echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}" + echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}" ;; *) - echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}" + echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}" usage ;; esac diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index 96f60c40..d83c8c40 100644 --- a/usr/local/share/bastille/cmd.sh +++ b/usr/local/share/bastille/cmd.sh @@ -56,4 +56,5 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" jexec -l ${_jail} $2 + echo done diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index fc527822..66f7e9ee 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -55,5 +55,6 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" - jexec -l ${_jail} /usr/bin/login -fp root + jexec -l ${_jail} /usr/bin/login -f root + echo done diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index dfe577b4..c1b546ff 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -58,5 +58,5 @@ for _jail in ${JAILS}; do bastille_jail_path="${bastille_jailsdir}/${_jail}/root" echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" cp -a "$2" "${bastille_jail_path}/$3" - echo -e "${COLOR_RESET}" + echo done diff --git a/usr/local/share/bastille/freebsd_dist_fetch.sh b/usr/local/share/bastille/freebsd_dist_fetch.sh index 9bccd481..821f3c51 100644 --- a/usr/local/share/bastille/freebsd_dist_fetch.sh +++ b/usr/local/share/bastille/freebsd_dist_fetch.sh @@ -1,6 +1,9 @@ #!/bin/sh +# https://pastebin.com/T6eThbKu DEVICE_SELF_SCAN_ALL=NO +DIALOG_BACKTITLE="BastilleBSD" +DIALOG_TITLE="bootstrap" [ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr usage(){ echo "Usage: ${0##*/} [-r releaseName] [dists ...]" >&2; exit 1; } while getopts hr: flag; do @@ -21,13 +24,13 @@ REL_DIST=/usr/local/bastille/cache/$releaseName download() # $src to $dest { size=$( f_device_get device_media "$1" $PROBE_SIZE ) - f_device_get device_media "$1" | dpv -kb "BastilleBSD" \ - -t "bootstrap" -p "Downloading $releaseName" \ + f_device_get device_media "$1" | dpv -kb "$DIALOG_BACKTITLE" \ + -t "$DIALOG_TITLE" -p "Downloading $releaseName" \ -o "$3" "$size:$1" } sign() # $file { - dpv -kb "BastilleBSD" -t "bootstrap" \ + dpv -kb "$DIALOG_BACKTITLE" -t "$DIALOG_TITLE" \ -p "Signing $releaseName" -mx "sha256 >&2" \ "$size:${1##*/}" "$1" 2>&1 >&$TERMINAL_STDOUT_PASSTHRU } diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index 202b0791..52a19541 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -29,9 +29,10 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/colors.pre.sh +. /usr/local/etc/bastille/bastille.conf usage() { - echo -e "${COLOR_RED}Usage: bastille list.${COLOR_RESET}" + echo -e "${COLOR_RED}Usage: bastille list [release|template|jail|log].${COLOR_RESET}" exit 1 } @@ -45,6 +46,18 @@ if [ $# -gt 0 ]; then help|-h|--help) usage ;; + release|releases) + ls "${bastille_releasesdir}" + ;; + template|templates) + ls "${bastille_templatesdir}" + ;; + jail|jails) + ls "${bastille_jailsdir}" + ;; + log|logs) + ls "${bastille_logsdir}" + ;; *) usage ;; diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index cfefdaf4..d56b6925 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -56,4 +56,5 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" jexec -l ${_jail} /usr/sbin/pkg $2 + echo done diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index 4528212d..ad1562f2 100644 --- a/usr/local/share/bastille/service.sh +++ b/usr/local/share/bastille/service.sh @@ -57,5 +57,5 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" jexec -l ${_jail} /usr/sbin/service $2 - echo -e "${COLOR_RESET}" + echo done diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index bff5cefe..edf9febc 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -62,6 +62,7 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -c ${_jail} + echo done ## HUP the firewall diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 704cc8c5..7bae666d 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -57,6 +57,7 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -r ${_jail} + echo done ## HUP the firewall diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index eaa15643..fedc5f88 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -64,7 +64,7 @@ for _jail in ${JAILS}; do if [ -s "${bastille_template}/PRE" ]; then echo -e "${COLOR_GREEN}Executing PRE-command(s).${COLOR_RESET}" bastille_templatepre=$(cat "${bastille_template}/PRE") - jexec -l "${_jail}" "${bastille_templatepre}" + jexec -l "${_jail}" /bin/sh "${bastille_templatepre}" fi ## config