Update list command and config

This commit is contained in:
Jose
2020-01-28 18:57:51 -04:00
parent 095075b142
commit 38ae0ed4a6
3 changed files with 36 additions and 38 deletions

View File

@@ -23,11 +23,14 @@ bastille_tzdata="etc/UTC" ## default: "etc/UTC"
## default jail resolv.conf ## default jail resolv.conf
bastille_resolv_conf="/etc/resolv.conf" ## default: "/etc/resolv.conf" bastille_resolv_conf="/etc/resolv.conf" ## default: "/etc/resolv.conf"
## bootstrap urls
bastille_url_freebsd="http://ftp.freebsd.org/pub/FreeBSD/releases/" ## default: "http://ftp.freebsd.org/pub/FreeBSD/releases/"
bastille_url_hardenedbsd="https://installer.hardenedbsd.org/pub/HardenedBSD/releases/" ## default: "https://installer.hardenedbsd.org/pub/HardenedBSD/releases/"
## ZFS options ## ZFS options
bastille_zfs_enable="" ## default: "" bastille_zfs_enable="" ## default: ""
bastille_zfs_zpool="" ## default: "" bastille_zfs_zpool="" ## default: ""
bastille_zfs_prefix="bastille" ## default: "${bastille_zfs_zpool}/bastille" bastille_zfs_prefix="bastille" ## default: "${bastille_zfs_zpool}/bastille"
bastille_zfs_mountpoint=${bastille_prefix} ## default: "${bastille_prefix}"
bastille_zfs_options="-o compress=lz4 -o atime=off" ## default: "-o compress=lz4 -o atime=off" bastille_zfs_options="-o compress=lz4 -o atime=off" ## default: "-o compress=lz4 -o atime=off"
## Export/Import options ## Export/Import options

View File

@@ -181,21 +181,12 @@ if [ ! -d "${bastille_backupsdir}" ]; then
error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}" error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}"
fi fi
# Handle additional options
case "${TARGET}" in
list)
ls "${bastille_backupsdir}" | grep -Ev "*.sha256"
exit 0
;;
*)
# Check if archive exist then trim archive name # Check if archive exist then trim archive name
if [ "$(ls "${bastille_backupsdir}" | awk "/^${TARGET}$/")" ]; then if [ "$(ls "${bastille_backupsdir}" | awk "/^${TARGET}$/")" ]; then
TARGET_TRIM=$(echo ${TARGET} | sed "s/_[0-9]*-[0-9]*-[0-9]*-[0-9]*:[0-9]*:[0-9]*.[txz]\{2,3\}//") TARGET_TRIM=$(echo ${TARGET} | sed "s/_[0-9]*-[0-9]*-[0-9]*-[0-9]*:[0-9]*:[0-9]*.[txz]\{2,3\}//")
else else
error_notify "${COLOR_RED}Archive '${TARGET}' not found.${COLOR_RESET}" error_notify "${COLOR_RED}Archive '${TARGET}' not found.${COLOR_RESET}"
fi fi
;;
esac
# Check if a running jail matches name or already exist # Check if a running jail matches name or already exist
if [ -n "$(jls name | awk "/^${TARGET_TRIM}$/")" ]; then if [ -n "$(jls name | awk "/^${TARGET_TRIM}$/")" ]; then

View File

@@ -80,6 +80,10 @@ if [ $# -gt 0 ]; then
limit|limits) limit|limits)
rctl -h jail: rctl -h jail:
;; ;;
import|imports|export|exports|backup|backups)
ls "${bastille_backupsdir}" | grep -Ev "*.sha256"
exit 0
;;
*) *)
usage usage
;; ;;