From a8b6b97b23e455a0872f80930599dbb7fa8a846c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 1 Jun 2021 11:26:58 +0200 Subject: [PATCH] debian: add manage wrapper script --- debian/pfwb-archives-proxy-manage | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 debian/pfwb-archives-proxy-manage diff --git a/debian/pfwb-archives-proxy-manage b/debian/pfwb-archives-proxy-manage new file mode 100755 index 0000000..4eac1ce --- /dev/null +++ b/debian/pfwb-archives-proxy-manage @@ -0,0 +1,25 @@ +#!/bin/sh + +NAME=pfwb-archives-proxy +MANAGE=/usr/lib/$NAME/manage.py + +# load Debian default configuration +export PFWB_ARCHIVES_PROXY_SETTINGS_FILE=/usr/lib/$NAME/debian_config.py + +# check user +if test x$1 = x"--forceuser" +then + shift +elif test $(id -un) != "$NAME" +then + echo "error: must use $0 with user ${NAME}" + exit 1 +fi + +if test $# -eq 0 +then + python3 ${MANAGE} help + exit 1 +fi + +python3 ${MANAGE} "$@"