I want my root-requiring bash script to run from IntelliJ / WebStorm , asking me for the root password when I run it. Of course, my root password is hardcoded in the script.
IntelliJ / WebStorm has a $ Prompt $ macro for such reasons, which asks you and uses your input as a value.
So I tried using $ Prompt $ along with echo YOURPASSWORD | sudo -S yourcommand echo YOURPASSWORD | sudo -S yourcommand as described in use-sudo-with-password-as-parameter .
Then I pass passwd and script to run until sudorun.sh script echo -e $1 | sudo -S $2 $3 $4 echo -e $1 | sudo -S $2 $3 $4 (since echo cannot be a "program"), which although it works in the CLI, cannot read echo-stdin in the IntelliJ console.
Ideally, I would like the solution to be configured exclusively from IntelliJ and not require specific OS configuration changes outside of IntelliJ.
There may be other ways to deal with this, so let's improvise!
source share