jails and incs lists are sorted alphanumerically
This commit is contained in:
parent
39901967a7
commit
7d1964370d
|
@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* jails and incs lists are sorted alphanumerically
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
@ -10,6 +10,4 @@ set -eu
|
||||||
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
|
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
|
||||||
|
|
||||||
[ -d "${JAILDIR}" ] || exit 0
|
[ -d "${JAILDIR}" ] || exit 0
|
||||||
#TODO: try if this command works the same :
|
jails_list
|
||||||
# find "${JAILDIR}" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'
|
|
||||||
find "${JAILDIR}" -mindepth 1 -maxdepth 1 -type d|sed 's!.*/!!'
|
|
||||||
|
|
36
lib/includes
36
lib/includes
|
@ -94,14 +94,9 @@ is_btrfs() {
|
||||||
|
|
||||||
# Returns the list of all jails
|
# Returns the list of all jails
|
||||||
jails_list() {
|
jails_list() {
|
||||||
# shellcheck disable=SC2091
|
# TODO: try if this command works the same :
|
||||||
"${LIBDIR}/bkctld-list"
|
# find "${JAILDIR}" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'
|
||||||
}
|
find "${JAILDIR}" -mindepth 1 -maxdepth 1 -type d | sed 's!.*/!!' | sort -h
|
||||||
# Returns the list of all incs for a jail
|
|
||||||
incs_list() {
|
|
||||||
jail_name=${1:?}
|
|
||||||
# shellcheck disable=SC2091
|
|
||||||
ls "$(incs_path "${jail_name}")/"
|
|
||||||
}
|
}
|
||||||
# Returns the complete path of a jail
|
# Returns the complete path of a jail
|
||||||
jail_path() {
|
jail_path() {
|
||||||
|
@ -109,6 +104,18 @@ jail_path() {
|
||||||
|
|
||||||
echo "${JAILDIR}/${jail_name}"
|
echo "${JAILDIR}/${jail_name}"
|
||||||
}
|
}
|
||||||
|
jail_config_dir() {
|
||||||
|
jail_name=${1:?}
|
||||||
|
|
||||||
|
echo "${CONFDIR}/${jail_name}.d"
|
||||||
|
}
|
||||||
|
jail_incs_policy_file() {
|
||||||
|
jail_name=${1:?}
|
||||||
|
|
||||||
|
jail_config_dir=$(jail_config_dir "${jail_name}")
|
||||||
|
|
||||||
|
echo "${jail_config_dir}/incs_policy"
|
||||||
|
}
|
||||||
# Returns the path of incs for a jail
|
# Returns the path of incs for a jail
|
||||||
incs_path() {
|
incs_path() {
|
||||||
jail_name=${1:?}
|
jail_name=${1:?}
|
||||||
|
@ -131,17 +138,10 @@ inc_exists() {
|
||||||
# inc_path must not be quoted because it can contain globs
|
# inc_path must not be quoted because it can contain globs
|
||||||
ls -d ${inc_path} > /dev/null 2>&1
|
ls -d ${inc_path} > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
jail_config_dir() {
|
# Returns the list of all incs for a jail
|
||||||
|
incs_list() {
|
||||||
jail_name=${1:?}
|
jail_name=${1:?}
|
||||||
|
find "$(incs_path "${jail_name}")" -mindepth 1 -maxdepth 1 -type d | sed 's!.*/!!' | sort -h
|
||||||
echo "${CONFDIR}/${jail_name}.d"
|
|
||||||
}
|
|
||||||
jail_incs_policy_file() {
|
|
||||||
jail_name=${1:?}
|
|
||||||
|
|
||||||
jail_config_dir=$(jail_config_dir "${jail_name}")
|
|
||||||
|
|
||||||
echo "${jail_config_dir}/incs_policy"
|
|
||||||
}
|
}
|
||||||
current_jail_incs_policy_file() {
|
current_jail_incs_policy_file() {
|
||||||
jail_name=${1:?}
|
jail_name=${1:?}
|
||||||
|
|
Loading…
Reference in a new issue