mirror of
https://github.com/plantroon/mx-puppet-xmpp.git
synced 2024-11-15 07:51:40 +00:00
add docker run
This commit is contained in:
parent
4cdddc4996
commit
34a5128285
38
docker-run.sh
Normal file
38
docker-run.sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
if [ ! -f "$CONFIG_PATH" ]; then
|
||||||
|
echo 'No config found'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
args="$@"
|
||||||
|
|
||||||
|
if [ ! -f "$REGISTRATION_PATH" ]; then
|
||||||
|
echo 'No registration found, generating now'
|
||||||
|
args="-r"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# if no --uid is supplied, prepare files to drop privileges
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
chown node:node /data
|
||||||
|
|
||||||
|
if find *.db > /dev/null 2>&1; then
|
||||||
|
# make sure sqlite files are writeable
|
||||||
|
chown node:node *.db
|
||||||
|
fi
|
||||||
|
if find *.log.* > /dev/null 2>&1; then
|
||||||
|
# make sure log files are writeable
|
||||||
|
chown node:node *.log.*
|
||||||
|
fi
|
||||||
|
|
||||||
|
su_exec='su-exec node:node'
|
||||||
|
else
|
||||||
|
su_exec=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
# $su_exec is used in case we have to drop the privileges
|
||||||
|
exec $su_exec /usr/local/bin/node '/opt/mx-puppet-skype/build/index.js' \
|
||||||
|
-c "$CONFIG_PATH" \
|
||||||
|
-f "$REGISTRATION_PATH" \
|
||||||
|
$args
|
Loading…
Reference in New Issue
Block a user