I want to use When Gnome Scheduler to run this:
sudo service fancontrol start
As "sudo" needs a password, how can I add it into the command, so that it can be run successfully? Each time Mint resumes after suspension, it needs to be run again.
I want to use When Gnome Scheduler to run this:
sudo service fancontrol start
As "sudo" needs a password, how can I add it into the command, so that it can be run successfully? Each time Mint resumes after suspension, it needs to be run again.
Instead of wondering how to get a password into a script I'd suggest modifying sudoers (or, even better [because cleaner], adding a separate file for this purpose to /etc/sudoers.d/
).
Something like (assuming matthew's your username):
cat /etc/sudoers.d/fancontrol
matthew ALL=NOPASSWD: /usr/sbin/service fancontrol start
Make sure it has the right permissions, and best to use visudo to edit it (that makes sure you don't have syntax errors in the file).
chmod 0440 /etc/sudoers.d/fancontrol
visudo
? And no, the idea was to apply those perms to the newly created file in/etc/sudoers.d
... Not sure what went wrong for you there. – tink Feb 09 '19 at 17:10