Ten problem od dłuższego czasu mnie wkurza.
Od czasu do czasu muszę napisać plik skryptu, który powinien wykonywać sudopolecenia. Niekoniecznie wiem z góry, że będę działać, sudowięc jestem pewien, że istnieje sposób, aby otworzyć ładny interfejs graficzny (taki jak ten, który pojawia się podczas instalacji oprogramowania), ale jak?
man sudoMówi:
-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
Jestem więc prawie pewien, że rozwiązanie w tym tkwi -Ai SUDO_ASKPASSkrotki, ale udało mi się znaleźć, co w to włożyć.
gtksudolubkdesudo. Nie wiem, co jest po stronie OS-X, ale zakładam, że szukasz czegoś podobnego.