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