Similar to zone_config_settings_write and zone_config_settings_read this function provides an easy way to delete a config file.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/functions/functions.zone | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/src/functions/functions.zone b/src/functions/functions.zone index acf68f5..44237cd 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -1272,6 +1272,24 @@ zone_config_settings_write() { settings_write "${path}" ${args} }
+zone_config_settings_destroy() { + # This function deletes the config file for a given zone and config + assert [ $# -ge 2 ] + local zone="${1}" + local config="${2}" + + local path="$(zone_dir "${zone}")/configs/${config}" + + # Check if path is valid + if [ ! -f ${path} ]; then + log ERROR "Path: '${path}' is not valid" + return ${EXIT_ERROR} + fi + + log DEBUG "Deleting config file ${path}" + rm -f "${path}" + +} zone_port_settings_read() { assert [ $# -ge 2 ]