ayaports/user/peertube/peertube-manage.sh

15 lines
308 B
Bash

#!/bin/sh
BUNDLE_DIR='/usr/share/webapps/peertube'
cd $BUNDLE_DIR
if [ "$(id -un)" != 'peertube' ]; then
source /etc/conf.d/peertube
export NODE_ENV NODE_CONFIG_DIR
exec su peertube -c '"$0" "$@"' -- npm run "$@"
else
source /etc/conf.d/peertube
export NODE_ENV NODE_CONFIG_DIR
exec npm run "$@"
fi