Ah, I just saw that you show the name of your script. My script is called test
and contains the following:
#!/bin/vbash
if [ "$(id -g -n)" != 'vyattacfg' ] ; then
exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
fi
echo "pipo"
Could you test by renaming your script?