mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-23 18:50:46 +01:00
import: Fix TARGET_TRIM var
This commit is contained in:
@@ -715,9 +715,8 @@ jail_import() {
|
|||||||
|
|
||||||
# Check for user specified file location
|
# Check for user specified file location
|
||||||
if echo "${TARGET}" | grep -q '\/'; then
|
if echo "${TARGET}" | grep -q '\/'; then
|
||||||
GETDIR="${TARGET}"
|
TARGET="$(basename ${TARGET})"
|
||||||
TARGET=$(echo ${TARGET} | awk -F '\/' '{print $NF}')
|
bastille_backupsdir="$(dirname ${TARGET})"
|
||||||
bastille_backupsdir=$(echo ${GETDIR} | sed "s/${TARGET}//")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if backups directory/dataset exist
|
# Check if backups directory/dataset exist
|
||||||
@@ -746,11 +745,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if a running jail matches name or already exist
|
# Check if a running jail matches name or already exist
|
||||||
if check_target_exists "${TARGET}"; then
|
if check_target_exists "${TARGET_TRIM}"; then
|
||||||
error_exit "[ERROR]: Jail: ${TARGET} already exists."
|
error_exit "[ERROR]: Jail: ${TARGET_TRIM} already exists."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${TARGET}" ]; then
|
if [ -n "${TARGET}" ]; then
|
||||||
info "\nAttempting to import jail: ${TARGET}..."
|
info "\nAttempting to import jail: ${TARGET_TRIM}..."
|
||||||
jail_import
|
jail_import
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user