ayaports/user/loomio/bin-wrapper.in

15 lines
342 B
Bash

#!/bin/sh
BUNDLE_DIR='/usr/lib/webapps/loomio'
export RAILS_ENV='production'
export NODE_ENV='production'
export EXECJS_RUNTIME='Disabled'
cd $BUNDLE_DIR
install -m 700 -o loomio -g loomio -d "$(readlink ./tmp)"
if [ "$(id -un)" != 'loomio' ]; then
exec su loomio -c '"$0" "$@"' -- bin/__COMMAND__ "$@"
else
exec bin/__COMMAND__ "$@"
fi