This repository was archived by the owner on Jan 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
root/etc/s6-overlay/s6-rc.d/svc-unifi-controller Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [[ $( curl -skL " https://localhost:${WEB_PORT:- 8443} /status" | jq -r ' .meta.up' 2> /dev/null) = true ]]; then
4
+ exit 0
5
+ else
6
+ exit 1
7
+ fi
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
# shellcheck shell=bash
3
3
4
+ WEB_PORT=$(grep 'unifi.https.port=' '/config/data/system.properties' | awk -F '=' '{print $2}')
5
+
4
6
if [[ -z ${MEM_LIMIT} ]] || [[ ${MEM_LIMIT} = "default" ]]; then
5
7
MEM_LIMIT="1024"
6
8
fi
7
9
8
10
if [[ -z ${MEM_STARTUP} ]] || [[ ${MEM_STARTUP} = "default" ]]; then
9
11
exec \
10
- s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8443" \
12
+ s6-notifyoncheck -d -n 600 -w 1000 \
11
13
cd /config s6-setuidgid abc java -Xmx"${MEM_LIMIT}M" -Dlog4j2.formatMsgNoLookups=true -jar /usr/lib/unifi/lib/ace.jar start;
12
14
else
13
15
exec \
14
- s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8443" \
16
+ s6-notifyoncheck -d -n 600 -w 1000 \
15
17
cd /config s6-setuidgid abc java -Xms"${MEM_STARTUP}M" -Xmx"${MEM_LIMIT}M" -Dlog4j2.formatMsgNoLookups=true -jar /usr/lib/unifi/lib/ace.jar start;
16
18
fi
You can’t perform that action at this time.
0 commit comments