From 21e4bc935dd677088e1c09bd66fe43fcb0032250 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 18 Nov 2020 18:33:08 +0100 Subject: [PATCH] Fix CLI wrapper and rename CLI tool to eesyphp --- bin/{items => eesyphp} | 0 bin/eesyphp.wrapper | 11 +++++++++++ bin/items.wrapper | 8 -------- 3 files changed, 11 insertions(+), 8 deletions(-) rename bin/{items => eesyphp} (100%) create mode 100755 bin/eesyphp.wrapper delete mode 100755 bin/items.wrapper diff --git a/bin/items b/bin/eesyphp similarity index 100% rename from bin/items rename to bin/eesyphp diff --git a/bin/eesyphp.wrapper b/bin/eesyphp.wrapper new file mode 100755 index 0000000..eca046c --- /dev/null +++ b/bin/eesyphp.wrapper @@ -0,0 +1,11 @@ +#!/bin/bash + +USER=$( basename $0 ) +REAL_BIN=$( realpath -L $0|sed 's/\.wrapper$//' ) +if [ "$( id -u -n )" != "$USER" ] +then + sudo -u $USER $REAL_BIN $@ + exit $? +fi +$REAL_BIN $@ +exit $? diff --git a/bin/items.wrapper b/bin/items.wrapper deleted file mode 100755 index 1b2d1d3..0000000 --- a/bin/items.wrapper +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [ "$( id -u -n )" != "$( basename $0 )" ] -then - sudo -u $( basename $0 ) $0 $@ - exit $? -fi -$( realpath -L $0|sed 's/\.wrapper$//' ) $@