Questo problema mi sta tormentando da un po 'di tempo ormai.
Ogni tanto ho bisogno di scrivere un file di script che dovrebbe eseguire i sudocomandi. Non so necessariamente in anticipo che eseguirò, sudoquindi sono sicuro che c'è un modo per aprire una bella interfaccia grafica (come quella che appare quando si installa il software) ma come?
La man sudodice:
-A Normally, if sudo requires a password, it will read it from the current terminal. If the -A (askpass) option is specified, a (possibly
graphical) helper program is executed to read the user's password and output the password to the standard output. If the SUDO_ASKPASS
environment variable is set, it specifies the path to the helper program. Otherwise, the value specified by the askpass option in
sudoers(5) is used
Quindi sono abbastanza sicuro che la soluzione risieda in quello -Ae SUDO_ASKPASStuplo comunque sono riuscito a trovare cosa mettere in quelli.
gtksudookdesudo. Non so cosa ci sia dal lato OS-X delle cose, ma suppongo che tu stia cercando qualcosa in questo senso.