Fix CLI wrapper and rename CLI tool to eesyphp

This commit is contained in:
Benjamin Renard 2020-11-18 18:33:08 +01:00
parent 63bab08c48
commit 21e4bc935d
3 changed files with 11 additions and 8 deletions

11
bin/eesyphp.wrapper Executable file
View file

@ -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 $?

View file

@ -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$//' ) $@