aboutsummaryrefslogtreecommitdiff
path: root/demo/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'demo/entrypoint.sh')
-rwxr-xr-xdemo/entrypoint.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/demo/entrypoint.sh b/demo/entrypoint.sh
new file mode 100755
index 0000000..e060597
--- /dev/null
+++ b/demo/entrypoint.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+USER_SHELL="${USER_SHELL:-/bin/ash}"
+# UID and GID used by the `git` user inside of the container
+USER_UID="${USER_UID:-3500}"
+USER_GID="${USER_GID:-3500}"
+
+TRUSTED_CIDRS="${TRUSTED_CIDRS:-127.0.0.1/8}"
+
+# LISTEN="${LISTEN:-:8899}"
+
+username="steam"
+userhome="/steam"
+
+# This is only run once in the container's lifetime unless /setup is removed
+setup() {
+if [ -e /setup ] ; then return ; fi
+
+addgroup -g "${USER_GID}" "$username"
+adduser -h "$userhome" --gecos "$FULL_NAME" -D \
+ -s "${USER_SHELL}" -u "${USER_UID}" -G "$username" "$username"
+passwd -u "$username"
+
+touch /setup
+}
+
+run_steam_export() {
+mkdir -p /steam-lib/common
+chown -R "$username:$username" /steam
+chown -R "$username:$username" /steam-lib
+su steam -c "steam-export -demo -L /steam-lib -t \"$TRUSTED_CIDRS\" -s \"$SHARE_LINK\""
+}
+
+setup
+run_steam_export