23
23
24
24
if grep -q "xmx" /config/data/system.properties && grep -q "xms" /config/data/system.properties; then
25
25
26
- if [[ -n $MEM_LIMIT ]]; then
26
+ if [[ $MEM_LIMIT == "default" ]]; then
27
+ echo "*** Setting Java memory limit to default ***"
28
+ sed -i "/unifi.xmx=.*/d" /config/data/system.properties
29
+ elif [[ -n $MEM_LIMIT ]]; then
27
30
echo "*** Setting Java memory limit to $MEM_LIMIT ***"
28
31
sed -i "s/unifi.xmx=.*/unifi.xmx=$MEM_LIMIT/" /config/data/system.properties
29
32
fi
30
33
31
- if [[ -n $MEM_STARTUP ]]; then
34
+ if [[ $MEM_STARTUP == "default" ]]; then
35
+ echo "*** Setting Java memory minimum to default ***"
36
+ sed -i "/unifi.xms=.*/d" /config/data/system.properties
37
+ elif [[ -n $MEM_STARTUP ]]; then
32
38
echo "*** Setting Java memory minimum to $MEM_STARTUP ***"
33
39
sed -i "s/unifi.xms=.*/unifi.xms=$MEM_STARTUP/" /config/data/system.properties
34
40
fi
35
41
36
42
elif grep -q "xmx" /config/data/system.properties; then
37
43
38
- if [[ -n $MEM_LIMIT ]]; then
44
+ if [[ $MEM_LIMIT == "default" ]]; then
45
+ echo "*** Setting Java memory limit to default ***"
46
+ sed -i "/unifi.xmx=.*/d" /config/data/system.properties
47
+ elif [[ -n $MEM_LIMIT ]]; then
39
48
echo "*** Setting Java memory limit to $MEM_LIMIT ***"
40
- sed -i "s/unifi.xmx=.*/unifi.xmx=$MEM_LIMIT/" /config/data/system.properties
49
+ sed -i "s/unifi.xmx=.*/unifi.xmx=$MEM_LIMIT/" /config/data/system.properties
41
50
fi
42
51
43
52
if [[ -n $MEM_STARTUP ]]; then
@@ -47,7 +56,10 @@ elif grep -q "xmx" /config/data/system.properties; then
47
56
48
57
elif grep -q "xms" /config/data/system.properties; then
49
58
50
- if [[ -n $MEM_STARTUP ]]; then
59
+ if [[ $MEM_STARTUP == "default" ]]; then
60
+ echo "*** Setting Java memory minimum to default ***"
61
+ sed -i "/unifi.xms=.*/d" /config/data/system.properties
62
+ elif [[ -n $MEM_STARTUP ]]; then
51
63
echo "*** Setting Java memory minimum to $MEM_STARTUP ***"
52
64
sed -i "s/unifi.xms=.*/unifi.xms=$MEM_STARTUP/" /config/data/system.properties
53
65
fi
0 commit comments