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

Commit 476c536

Browse files
committed
Improve sed
1 parent 9381064 commit 476c536

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

root/etc/cont-init.d/20-config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ if grep -q "xmx" /config/data/system.properties && grep -q "xms" /config/data/sy
2525

2626
if [[ -n $MEM_LIMIT ]]; then
2727
echo "*** Setting Java memory limit to $MEM_LIMIT ***"
28-
sed -i "s/unifi.xmx=.*/unifi.xmx=$MEM_LIMIT/" /config/data/system.properties
28+
sed -i "s/unifi.xmx=[0-9]\{1,5\}/unifi.xmx=$MEM_LIMIT/" /config/data/system.properties
2929
fi
3030

3131
if [[ -n $MEM_STARTUP ]]; then
3232
echo "*** Setting Java memory minimum to $MEM_STARTUP ***"
33-
sed -i "s/unifi.xms=.*/unifi.xms=$MEM_STARTUP/" /config/data/system.properties
33+
sed -i "s/unifi.xms=[0-9]\{1,5\}/unifi.xms=$MEM_STARTUP/" /config/data/system.properties
3434
fi
3535

3636
else

0 commit comments

Comments
 (0)