I am having the following issue:
I am running a script where I do the following (myscript.sh - found in /home/pi):
echo $USER
echo $UID
I can run that script from bash and node-red with the same result:
pi
1000
But when I try the shutdown command:
shutdown -r now
I cannot execute that from node-red but I can execute it without problems from bash, although the same user is there (pi).
Is there an explanation for this?
Thanks!
Try with using
sudo shutdown -r now
You are running node-red as a regular user, not as a superuser. Meanwhile, bash is always run as superuser.