Skip to content

Commit

Permalink
Update run script to include environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecamel committed Oct 8, 2021
1 parent 3ce397c commit a14d856
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions run_gpu_intel.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/usr/bin/env bash

if [ "${RENDER_GROUP_ID}" -ne 0 ]; then
groupadd -g "${RENDER_GROUP_ID}" render
usermod -aG render odm
if [ ! -z "${RENDER_GROUP_ID}" ]; then
if [ "${RENDER_GROUP_ID}" -ne 0 ]; then
groupadd -g "${RENDER_GROUP_ID}" render
usermod -aG render odm
fi
fi

su - odm -c "/usr/bin/node /var/www/index.js $@"
while IFS='=' read -r name value ; do
echo "export ${name}=\"${value}\"" >> /home/odm/env
done < <(env)
chown odm:odm /home/odm/env

su - odm -c "source /home/odm/env; cd /var/www; echo $WO_DEFAULT_NODES; /usr/bin/node /var/www/index.js $@"

0 comments on commit a14d856

Please sign in to comment.