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

@@ -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

View File

@@ -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
;;