Update list command and config
This commit is contained in:
@@ -181,21 +181,12 @@ if [ ! -d "${bastille_backupsdir}" ]; then
|
||||
error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}"
|
||||
fi
|
||||
|
||||
# Handle additional options
|
||||
case "${TARGET}" in
|
||||
list)
|
||||
ls "${bastille_backupsdir}" | grep -Ev "*.sha256"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
# Check if archive exist then trim archive name
|
||||
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\}//")
|
||||
else
|
||||
error_notify "${COLOR_RED}Archive '${TARGET}' not found.${COLOR_RESET}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# Check if archive exist then trim archive name
|
||||
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\}//")
|
||||
else
|
||||
error_notify "${COLOR_RED}Archive '${TARGET}' not found.${COLOR_RESET}"
|
||||
fi
|
||||
|
||||
# Check if a running jail matches name or already exist
|
||||
if [ -n "$(jls name | awk "/^${TARGET_TRIM}$/")" ]; then
|
||||
|
||||
@@ -80,6 +80,10 @@ if [ $# -gt 0 ]; then
|
||||
limit|limits)
|
||||
rctl -h jail:
|
||||
;;
|
||||
import|imports|export|exports|backup|backups)
|
||||
ls "${bastille_backupsdir}" | grep -Ev "*.sha256"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user