This repository has been archived on 2022-05-05. You can view files and clone it, but cannot push or open issues or pull requests.
userausfall/debian/system-files/userausfallctl

21 lines
378 B
Text
Raw Normal View History

#!/bin/sh
set -eu
EXEC_USER=_userausfall
. /etc/default/userausfall
export PYTHONPATH
export DJANGO_SETTINGS_MODULE
export USERAUSFALL_DATA_DIR
if [ "$(id -nu)" = "$EXEC_USER" ]; then
exec python3 -m django "$@"
elif [ "$(id -u)" = 0 ]; then
exec su -s "$0" "$EXEC_USER" -- "$@"
else
echo "please run $(basename "$0") as root or '$EXEC_USER'" >&2
exit 1
fi