diff --git a/usr/local/etc/bastille/bastille.conf.sample b/usr/local/etc/bastille/bastille.conf.sample index d7ccc755..367d27ea 100644 --- a/usr/local/etc/bastille/bastille.conf.sample +++ b/usr/local/etc/bastille/bastille.conf.sample @@ -51,6 +51,12 @@ bastille_compress_gz_options="-1 -v" ## default bastille_decompress_gz_options="-k -d -c -v" ## default "-k -d -c -v" bastille_export_options="" ## default "" predefined export options, e.g. "--safe --gz" +## CP and RCP options +bastille_cp_option="-a" ## default "-a" single term only +bastille_cp_option="-a" ## default "-a" single term only +bastille_rcp_option="-a" ## default "-a" single term only +bastille_rcp_option="-a" ## default "-a" single term only + ## Networking bastille_network_loopback="bastille0" ## default: "bastille0" bastille_network_pf_ext_if="ext_if" ## default: "ext_if" diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index cf895fe4..96e4202d 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -58,10 +58,10 @@ bastille_root_check case "${OPTION}" in -q|--quiet) - OPTION="-a" + OPTION="${bastille_cp_option:--a}" ;; *) - OPTION="-av" + OPTION="${bastille_cp_option:--a}v" ;; esac diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index 2a660439..602efa7e 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -69,6 +69,11 @@ destroy_jail() { fi if [ -d "${bastille_jail_base}" ]; then + ## make sure no filesystem is currently mounted in the jail directory + mount_points=$(mount | cut -d ' ' -f 3 | grep "^${bastille_jail_base}") + if [ $? -eq 0 ]; then + error_exit "Jail has mounted filesystems:\n$mount_points" + fi ## removing all flags chflags -R noschg "${bastille_jail_base}" diff --git a/usr/local/share/bastille/export.sh b/usr/local/share/bastille/export.sh index fc180b9a..36cc4186 100644 --- a/usr/local/share/bastille/export.sh +++ b/usr/local/share/bastille/export.sh @@ -212,7 +212,7 @@ if [ -n "${TXZ_EXPORT}" -o -n "${TGZ_EXPORT}" ] && [ -n "${SAFE_EXPORT}" ]; then error_exit "Error: Simple archive modes with safe ZFS export can't be used together." fi -if checkyesno bastille_zfs_enable; then +if ! checkyesno bastille_zfs_enable; then if [ -n "${GZIP_EXPORT}" -o -n "${RAW_EXPORT}" -o -n "${SAFE_EXPORT}" -o "${OPT_ZSEND}" = "-Rv" ]; then error_exit "Options --gz, --raw, --safe, --verbose are valid for ZFS configured systems only." fi diff --git a/usr/local/share/bastille/rcp.sh b/usr/local/share/bastille/rcp.sh index 09d1d2f8..e0d1a205 100644 --- a/usr/local/share/bastille/rcp.sh +++ b/usr/local/share/bastille/rcp.sh @@ -60,10 +60,10 @@ fi case "${OPTION}" in -q|--quiet) - OPTION="-a" + OPTION="${bastille_rcp_option:--a}" ;; *) - OPTION="-av" + OPTION="${bastille_rcp_option:--a}v" ;; esac diff --git a/usr/local/share/bastille/update.sh b/usr/local/share/bastille/update.sh index 582b22a3..d4f8f56a 100644 --- a/usr/local/share/bastille/update.sh +++ b/usr/local/share/bastille/update.sh @@ -120,6 +120,8 @@ release_update() { env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \ fetch --currently-running "${TARGET_TRIM}" env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \ + updatesready --currently-running "${TARGET_TRIM}" || return 0 + env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \ install --currently-running "${TARGET_TRIM}" else error_exit "${TARGET} not found. See 'bastille bootstrap'."