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

Commit bdecc5f

Browse files
authored
Merge pull request #8 from linuxserver/alpine-autostart
add ability to autostart applications
2 parents 40d3167 + 1d86d3b commit bdecc5f

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ RUN \
111111
nodejs \
112112
openbox && \
113113
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114-
ossp-uuid && \
114+
ossp-uuid \
115+
websocat && \
115116
echo "**** openbox tweaks ****" && \
116117
sed -i \
117118
's/NLIMC/NLMC/g' \

Dockerfile.aarch64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ RUN \
111111
nodejs \
112112
openbox && \
113113
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114-
ossp-uuid && \
114+
ossp-uuid \
115+
websocat && \
115116
echo "**** openbox tweaks ****" && \
116117
sed -i \
117118
's/NLIMC/NLMC/g' \

Dockerfile.armhf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ RUN \
111111
nodejs \
112112
openbox && \
113113
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114-
ossp-uuid && \
114+
ossp-uuid \
115+
websocat && \
115116
echo "**** openbox tweaks ****" && \
116117
sed -i \
117118
's/NLIMC/NLMC/g' \

root/etc/services.d/autostart/run

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

0 commit comments

Comments
 (0)