This function is needed to implement the id feature described in #11405
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/functions/functions.zone | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/src/functions/functions.zone b/src/functions/functions.zone index b44d3b5..fcc7bfa 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -1048,6 +1048,19 @@ zone_config_hook_is_configured() { return ${EXIT_FALSE} }
+zone_config_id_is_valid() { + # This function checks if a given id is valid for a zone + # Return True when yes and false when no + + assert [ $# -eq 2 ] + local zone=${1} + local id=${2} + + local zone_path=$(zone_dir ${zone}) + + [ -f ${zone_path}/configs/*.${id} ]; +} + zone_has_ip() { device_has_ip $@ }