From bd97891a033903651e8ca2903afd1eaf04f6600b Mon Sep 17 00:00:00 2001 From: M3t4Data <37160039+M3t4Data@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:46:25 +0000 Subject: [PATCH] Add "0" as a valid choice --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 35c4c79..6cae8a0 100755 --- a/scripts/install +++ b/scripts/install @@ -16,8 +16,8 @@ source /usr/share/yunohost/helpers influxdb_admin_token=$(ynh_string_random --length=64 --filter='A-Za-z0-9-_') # Check if the retention value is valid -if ! echo "$influxdb_bucket_retention" | grep -qE '^[0-9]+(ns|u|µ|ms|s|m|h|d|w)$'; then - ynh_die --message="Invalid retention value. It should be a number followed by a duration unit (ns, u, µ, ms, s, m, h, d, w)." +if ! echo "$influxdb_bucket_retention" | grep -qE '^(0|[0-9]+(ns|u|µ|ms|s|m|h|d|w))$'; then + ynh_die --message="Invalid retention value. It should be either 0 (infinite) or a number followed by a duration unit (ns, u, µ, ms, s, m, h, d, w)." fi ynh_app_setting_set --app=$app --key=influxdb_org_name --value=$influxdb_org_name