Hi all,
I would like to make a button in the dashboard to execute a script. This script updates Node-Red like this: bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
In this previous post@TotallyInformation suggests that I use an exec node which will create a shell which can execute what I want with chil_process.exec.
The problem is that I am completely new to programming and I do not see how to write this script.
Can you help me ?
Thanks
Chris
Will that work, doesn't it need to be run in terminal so that you can enter the password when required. Or are your systems setup so as not to need a password for sudo?
Even then I am not certain it will work without a terminal session.
Apart from the comments from @Colin, which are relevant, why do you want to update node-red this way? The biggest problem I see is that you wouldn't see installation errors, if they occur.
the goal is to display on the Dashboard if a new version of NR is available online :
and if there is one, be able to update always from the Dashboard by clicking on a button which executes the update command or script.
Indeed, we do not see the errors but it avoids connecting to ssh and typing in the terminal to the update command.
If it is just node-red that you want to update then you could run directly using an exec node sudo npm install -g --unsafe-perm node-red
and then force a node-red restart or a reboot.