Always check if user specified path exist
This commit is contained in:
@@ -102,11 +102,11 @@ if echo "${TARGET}" | grep -q '\/'; then
|
|||||||
GETDIR="${TARGET}"
|
GETDIR="${TARGET}"
|
||||||
TARGET=$(echo ${TARGET} | awk -F '\/' '{print $NF}')
|
TARGET=$(echo ${TARGET} | awk -F '\/' '{print $NF}')
|
||||||
bastille_backupsdir=$(echo ${GETDIR} | sed "s/${TARGET}//")
|
bastille_backupsdir=$(echo ${GETDIR} | sed "s/${TARGET}//")
|
||||||
else
|
fi
|
||||||
# Check if backups directory/dataset exist
|
|
||||||
if [ ! -d "${bastille_backupsdir}" ]; then
|
# Check if backups directory/dataset exist
|
||||||
error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}"
|
if [ ! -d "${bastille_backupsdir}" ]; then
|
||||||
fi
|
error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if is a ZFS system
|
# Check if is a ZFS system
|
||||||
|
|||||||
@@ -377,11 +377,11 @@ if echo "${TARGET}" | grep -q '\/'; then
|
|||||||
GETDIR="${TARGET}"
|
GETDIR="${TARGET}"
|
||||||
TARGET=$(echo ${TARGET} | awk -F '\/' '{print $NF}')
|
TARGET=$(echo ${TARGET} | awk -F '\/' '{print $NF}')
|
||||||
bastille_backupsdir=$(echo ${GETDIR} | sed "s/${TARGET}//")
|
bastille_backupsdir=$(echo ${GETDIR} | sed "s/${TARGET}//")
|
||||||
else
|
fi
|
||||||
# Check if backups directory/dataset exist
|
|
||||||
if [ ! -d "${bastille_backupsdir}" ]; then
|
# Check if backups directory/dataset exist
|
||||||
error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}"
|
if [ ! -d "${bastille_backupsdir}" ]; then
|
||||||
fi
|
error_notify "${COLOR_RED}Backups directory/dataset does not exist, See 'bastille bootstrap'.${COLOR_RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if archive exist then trim archive name
|
# Check if archive exist then trim archive name
|
||||||
|
|||||||
Reference in New Issue
Block a user