Drop root privileges if necessary.

This makes it possible to call dokku commands as root.
This commit is contained in:
Paul Lietar
2013-11-25 23:03:12 +00:00
parent 10a8c75224
commit 2ed527bedc

5
dokku
View File

@@ -7,6 +7,11 @@ export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
[[ $DOKKU_TRACE ]] && set -x
if [[ $(id -un) != "dokku" && $1 != "plugins-install" ]]; then
sudo -u dokku -H $0 "$@"
exit
fi
case "$1" in
receive)
APP="$2"; IMAGE="app/$APP"