Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support option for all graphics front-end #118

Open
kuboosoft opened this issue Apr 7, 2014 · 0 comments
Open

Add support option for all graphics front-end #118

kuboosoft opened this issue Apr 7, 2014 · 0 comments

Comments

@kuboosoft
Copy link

Hi, I love your work, why no include a option for people as want use packer in a visual front-end ?. I would like an option that the user could invoke su or sudo; with zenity, gksu or another.

Example:
zenity --password | su -c "$(printf '%q ' "$@")"

elif zenity --password | sudo -S -v &>/dev/null && sudo -l "$@" &>/dev/null; then
sudo -E "$@"

or

gksu "$(printf '%q ' "$@")"

elif gksu sudo -S -v &>/dev/null && sudo -l "$@" &>/dev/null; then
sudo -E "$@"
////////////////////////
# Called whenever anything needs to be run as root ($@ is the command)
runasroot() {
if [[ $UID -eq 0 ]]; then
"$@"

elif sudo -v &>/dev/null && sudo -l "$@" &>/dev/null; then

elif zenity --password | sudo -S -v &>/dev/null && sudo -l "$@" &>/dev/null; then
sudo -E "$@"
else
echo -n "root "

su -c "$(printf '%q ' "$@")"

zenity --password | su -c "$(printf '%q ' "$@")"
fi
}
///////////////////////////////
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant