Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 790393d

Browse files
authored
Merge pull request #2 from linuxserver/res
override autostart to launch 1920x1080
2 parents af4113e + 6468a3b commit 790393d

File tree

1 file changed

+30
-0
lines changed
  • root/etc/services.d/autostart

1 file changed

+30
-0
lines changed

root/etc/services.d/autostart/run

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# set SUBFOLDER to default if unset
4+
if [ -z ${SUBFOLDER+x} ]; then
5+
SUBFOLDER="/"
6+
fi
7+
8+
# just sleep if autostart is not enabled
9+
if [ -z ${GUIAUTOSTART+x} ]; then
10+
echo "[guac-init] Auto start not set, application start on login"
11+
sleep infinity
12+
# start abc session by sending a token to guacamole via websockets
13+
else
14+
# make sure services are up
15+
until \
16+
$(true &>/dev/null </dev/tcp/localhost/3350) && \
17+
$(true &>/dev/null </dev/tcp/localhost/4822) && \
18+
$(true &>/dev/null </dev/tcp/localhost/${CUSTOM_PORT:=3000}) &&
19+
$(true &>/dev/null </dev/tcp/localhost/3389)
20+
do
21+
sleep .5
22+
done
23+
echo "[guac-init] Auto start set, starting application"
24+
sleep 1
25+
# generate a token based on env vars
26+
cd /gclient
27+
TOKEN=$(node maketoken.js)
28+
websocat -q -n "ws://localhost:${CUSTOM_PORT:=3000}${SUBFOLDER}guaclite?token=${TOKEN}&width=1920&height=1080"
29+
sleep infinity
30+
fi

0 commit comments

Comments
 (0)