View Full Version : Two Shell Scripting Questions
italiangirl6
12th February 2011, 06:12 AM
well I am trying to write a functional shell script that allows me to deactivate a node connected to my Linux, in this case my usb wifi card and to refresh and turn it back on. The other thing is I found this interesting command, "kdialog" with a --yesno for it. However for the life of me I am not certain how to get the functions for Yes and No to work properly. I do have basic C# and C++ knowledge and still learning. Any ideas?
DBelton
12th February 2011, 06:42 AM
you can do it somewhat like this...
kdialog --yesno "Do you wish to proceed?"
rc=$?
if [ "${rc}" == "0" ]; then
answer="yes"
else
answer="no"
fi
however, you may wish to look at zenity instead of kdialog. To me, it's much simpler to use to display Gtk+ dialog boxes from shell scripts.
italiangirl6
12th February 2011, 07:01 AM
wow thank you so much DBelton, that put my project ahead so much. I really appreciate it. ^-^
stevea
12th February 2011, 08:16 AM
+1 on zenity. Very basic but it fills a niche.
Examine the
nmcli nm wifi on
nmcli nm wifi off
commands.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.