1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/influxdb_v2_ynh.git synced 2024-09-03 19:26:11 +02:00

Add "0" as a valid choice

This commit is contained in:
M3t4Data 2024-01-31 22:46:25 +00:00
parent b140172833
commit bd97891a03

View file

@ -16,8 +16,8 @@ source /usr/share/yunohost/helpers
influxdb_admin_token=$(ynh_string_random --length=64 --filter='A-Za-z0-9-_') influxdb_admin_token=$(ynh_string_random --length=64 --filter='A-Za-z0-9-_')
# Check if the retention value is valid # 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 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 a number followed by a duration unit (ns, u, µ, ms, s, m, h, d, w)." 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 fi
ynh_app_setting_set --app=$app --key=influxdb_org_name --value=$influxdb_org_name ynh_app_setting_set --app=$app --key=influxdb_org_name --value=$influxdb_org_name