Discussion on:

3
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
I have several Zenity + scripts that I use for specific 'root' jobs that would normally be done on the command line with sudo. But ...

N.B.
To get zenity and sudo to cooperate you first must comment out the /etc/sudoers default
## Defaults requiretty

Once that is done sudo as part of a Zenity script will work. The following is an example of a simple script:

#! /bin/bash
# Open Emacs as root at / directory
# file name: RootEmacs

sudo -K
zenity --entry \
--title="Write root files" \
--text="Enter your user _password:" \
--entry-text "" \
--hide-text |sudo -S emacs --no-splash /

if [ "$?" != 0 ]; then
zenity --error --text="Sorry, wrong password"
exit 1
fi

# End

I launch RootEmacs from a desktop (or panel) launcher (icon). It is great for checking or changing configuration files on the fly.
0 Votes
+ -
cool... I used zenity to catalogue some files on my system. Thanks for the post.
0 Votes
+ -
Useful post, I've found a few good uses for it already! happy

Keep up the good work.

P
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.