fix shell script execute after su (#1581)

`su xxx -c bash a.sh`
it will execute like `su xxx -c bash` and ignore a.sh

in order to do right way

`su xxx -c "bash a.sh"`
This commit is contained in:
zhangn1985
2019-10-01 22:53:22 +08:00
committed by Igor Pečovnik
parent 2c0adc006a
commit de58ac1faa

View File

@@ -76,7 +76,7 @@ echo update_src >> $TMPFILE
#due to in docker/VM, we can't su to a normal user, so do not update/checkout git.
if [[ `systemd-detect-virt` == 'none' ]]; then
if [[ $EUID == 0 ]]; then
su `stat --format=%U $SRC/.git` -c bash $TMPFILE
su `stat --format=%U $SRC/.git` -c "bash $TMPFILE"
else
bash $TMPFILE
fi