Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 625a5bd

Browse files
committed
#14: Fixes validation of maxmemory and maxmemory-policy.
1 parent 94a3a33 commit 625a5bd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/usr/sbin/redis-server-bootstrap

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ set -e
44

55
function __is_valid_redis_maxmemory ()
66
{
7-
local -r memory_units='^[1-9][0-9]*(?i)(?:kb?|mb?|gb?)$'
7+
local -r memory_units='^[1-9][0-9]*(kb?|mb?|gb?|KB?|MB?|GB?)$'
88
local -r value="${1}"
9-
109
if [[ ${value} =~ ${memory_units} ]]
1110
then
1211
return 0
@@ -17,8 +16,8 @@ function __is_valid_redis_maxmemory ()
1716

1817
function __is_valid_redis_maxmemory_policy ()
1918
{
20-
local -r redis_policies='^(?:allkeys-lru|volatile-lru|volatile-random|allkeys-random|volatile-ttl|noeviction)$'
21-
local -r redis_policies_40='^(?:allkeys-lru|volatile-lru|volatile-lfu|allkeys-lfu|volatile-random|allkeys-random|volatile-ttl|noeviction)$'
19+
local -r redis_policies='^(allkeys-lru|volatile-lru|volatile-random|allkeys-random|volatile-ttl|noeviction)$'
20+
local -r redis_policies_40='^(allkeys-lru|volatile-lru|volatile-lfu|allkeys-lfu|volatile-random|allkeys-random|volatile-ttl|noeviction)$'
2221
local -r redis_version="$(
2322
__redis_version
2423
)"

0 commit comments

Comments
 (0)