Search the Community
Showing results for tags 'sudo'.
-
My goal is to automate the process of updating a user's hosts file. (/etc/hosts/) I have a bash script that works fine if I run it from my home directory. User opens Alfred and types in the keyword "hostsup" (No arguments required) Alfred opens a Terminal window and runs a script that has been added to the Workflow folder The script displays some informative text for the user Then the scripts ask the user if they would like to continue On 'y', the terminal prompts the user for their password (Because the command uses sudo) The script outputs a completion message and instructs the user to
- 1 reply
-
- terminal command
- bash
-
(and 2 more)
Tagged with:
-
From the README.md First: avoid, at all costs, adding a sudo entry. Only add an entry to your sudoers file as a last resort. If you do need to add an entry, however, this is a great way to do it because it will check your syntax with visudo, making sure that you do not break your sudoers file (which is really, really bad). Also included is "which" command that allows you to grab the path of the command you need to add to the sudoers file. Hence, just invoke "which <command_name>" and the path will be copied to your clipboard. After that, type "addsudo" — no arguments. You'll be