Introduction

I recently discovered with delight Zenity, developed by the Gnome team, which allows you to easily display GTK dialog boxes from shell scripts.

There is also dialog for ASCII GUI options.

Example of Restarting a Service

Here is an example to restart the openvpn service (openvpn-restart.sh):

  zenity --question --text="Start OpenVPN ?" --ok-label="Yes" --cancel-label="No"
if [ $? = 0 ] ; then
    sudo /etc/init.d/openvpn restart
fi
  

Last updated 14 Dec 2009, 08:31 +0200. history