From e9d72552dbcf8d50d18e8d02e048249ce66a2acf Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 16 Sep 2014 11:52:25 +0200 Subject: [PATCH] Add manage action to init.d --- debian/control | 1 + debian/portail-citoyen2.init | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/control b/debian/control index 3baa048..57bd630 100644 --- a/debian/control +++ b/debian/control @@ -37,6 +37,7 @@ Depends: ${misc:Depends}, adduser, python-django-south (>= 0.8.4), python-psycopg2, gunicorn, dbconfig-common, + sudo, debconf | debconf-2.0, ucf Recommends: postgresql-client Suggests: nginx, postgresql, authentic2 diff --git a/debian/portail-citoyen2.init b/debian/portail-citoyen2.init index c8fa54e..eea9055 100644 --- a/debian/portail-citoyen2.init +++ b/debian/portail-citoyen2.init @@ -180,6 +180,14 @@ case "$1" in ;; esac ;; + manage) + shift + if [ $(id -un) != "$USER" ]; then + sudo -H -u $USER /usr/bin/portail-citoyen-manage "$@" + else + /usr/bin/portail-citoyen-manage "$@" + fi + ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3