This repository was archived by the owner on Jan 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,30 @@ if [[ ! -e /config/data/system.properties ]]; then
21
21
cp /defaults/system.properties /config/data
22
22
fi
23
23
24
- if [[ -n $MEM_LIMIT ]]; then
25
- echo "*** Setting Java memory limit to $MEM_LIMIT ***"
26
- echo "unifi.xmx=$MEM_LIMIT" >> /config/data/system.properties
27
- fi
24
+ if grep -q "xmx" /config/data/system.properties && grep -q "xms" /config/data/system.properties; then
25
+
26
+ if [[ -n $MEM_LIMIT ]]; then
27
+ echo "*** Setting Java memory limit to $MEM_LIMIT ***"
28
+ sed -i "s/unifi.xmx=.*/unifi.xmx=$MEM_LIMIT/" /config/data/system.properties
29
+ fi
30
+
31
+ if [[ -n $MEM_STARTUP ]]; then
32
+ echo "*** Setting Java memory minimum to $MEM_STARTUP ***"
33
+ sed -i "s/unifi.xms=.*/unifi.xms=$MEM_STARTUP/" /config/data/system.properties
34
+ fi
35
+
36
+ else
37
+
38
+ if [[ -n $MEM_LIMIT ]]; then
39
+ echo "*** Setting Java memory limit to $MEM_LIMIT ***"
40
+ echo "unifi.xmx=$MEM_LIMIT" >> /config/data/system.properties
41
+ fi
42
+
43
+ if [[ -n $MEM_STARTUP ]]; then
44
+ echo "*** Setting Java memory minimum to $MEM_STARTUP ***"
45
+ echo "unifi.xms=$MEM_STARTUP" >> /config/data/system.properties
46
+ fi
28
47
29
- if [[ -n $MEM_STARTUP ]]; then
30
- echo "*** Setting Java memory minimum to $MEM_STARTUP ***"
31
- echo "unifi.xms=$MEM_STARTUP" >> /config/data/system.properties
32
48
fi
33
49
34
50
# permissions
You can’t perform that action at this time.
0 commit comments