diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index ef8ed63b..004bc8ab 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -156,7 +156,7 @@ destroy_rel() { BASE_HASCHILD="0" if [ -d "${bastille_jailsdir}" ]; then - JAIL_LIST=$(ls "${bastille_jailsdir}" | sed "s/\n//g") + JAIL_LIST=$(ls -v --color=never "${bastille_jailsdir}" | sed "s/\n//g") for _jail in ${JAIL_LIST}; do diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index be5dba0d..499daf8c 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -71,7 +71,7 @@ get_jail_list() { if [ -n "${TARGET}" ]; then JAIL_LIST="${TARGET}" else - JAIL_LIST="$(ls --color=never "${bastille_jailsdir}" | sed "s/\n//g")" + JAIL_LIST="$(ls -v --color=never "${bastille_jailsdir}" | sed "s/\n//g")" fi } @@ -583,7 +583,7 @@ list_release(){ if [ -d "${bastille_releasesdir}" ]; then # TODO: Check if this can be changed to `find` as SC2012 suggests. # shellcheck disable=SC2012 - REL_LIST="$(ls "${bastille_releasesdir}" | sed "s/\n//g")" + REL_LIST="$(ls -v --color=never "${bastille_releasesdir}" | sed "s/\n//g")" for _REL in ${REL_LIST}; do if [ -f "${bastille_releasesdir}/${_REL}/root/.profile" ] || [ -d "${bastille_releasesdir}/${_REL}/debootstrap" ]; then if [ "${1}" = "-p" ] && [ -f "${bastille_releasesdir}/${_REL}/bin/freebsd-version" ]; then @@ -602,7 +602,7 @@ list_snapshot(){ # TODO: Ability to list snapshot data for a single target. # List snapshots with its usage data for valid bastille jails only. if [ -d "${bastille_jailsdir}" ]; then - JAIL_LIST=$(ls --color=never "${bastille_jailsdir}" | sed "s/\n//g") + JAIL_LIST=$(ls -v --color=never "${bastille_jailsdir}" | sed "s/\n//g") for _JAIL in ${JAIL_LIST}; do if [ -f "${bastille_jailsdir}/${_JAIL}/jail.conf" ]; then info "\n[${_JAIL}]:" @@ -618,7 +618,7 @@ list_template(){ list_jail(){ if [ -d "${bastille_jailsdir}" ]; then - JAIL_LIST=$(ls --color=never "${bastille_jailsdir}" | sed "s/\n//g") + JAIL_LIST=$(ls -v --color=never "${bastille_jailsdir}" | sed "s/\n//g") for _JAIL in ${JAIL_LIST}; do if [ -f "${bastille_jailsdir}/${_JAIL}/jail.conf" ]; then echo "${_JAIL}" @@ -637,7 +637,7 @@ list_limit(){ list_import(){ # shellcheck disable=SC2010 - ls "${bastille_backupsdir}" | grep -v ".sha256$" + ls -v "${bastille_backupsdir}" | grep -v ".sha256$" } bastille_root_check diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 59ecbe36..f62017dd 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -88,7 +88,7 @@ set_target "${TARGET}" "reverse" for _jail in ${JAILS}; do # Validate that all jails that 'depend' on this one are stopped - for _depend_jail in $(ls --color=never ${bastille_jailsdir} | sed -e 's/\n//g'); do + for _depend_jail in $(ls -v --color=never ${bastille_jailsdir} | sed -e 's/\n//g'); do if ! grep -hoqsw "depend=" ${bastille_jailsdir}/${_depend_jail}/settings.conf; then sysrc -q -f ${bastille_jailsdir}/${_depend_jail}/settings.conf depend="" >/dev/null fi