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

Merge pull request #5 from YunoHost-Apps/3-impossible-to-use-infinite-rentention

Add "0" as a valid choice
This commit is contained in:
M3t4Data 2024-02-01 00:02:40 +01:00 committed by GitHub
commit 3910af662c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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