Hello, As part of my administration tasks I sometimes have to help remote users on who are dialing up there laptops while on trips to remote lands :-) The big problem is always talking the user through giving me their IP address... Click on the Konsole icon.... no, the one with the shell on it... type su - ... no, that's "s" as in sam, "u" as in user, space, dash... yes, it needs the root password... no not your password... ok now type exactly the letters I tell you... ifconfig |grep "inet "addr".... no that's "i" as in Internet, "f" as in frank... You get my point. So I'm trying to write a script that will do everything except type their own password for them. It currently looks as follows: #!/bin/bash xterm -fg black -bg white -e /usr/bin/sudo /sbin/ifconfig |grep "inet addr" When I run this script, up pops a window that is asking for the user's password, just like it's supposed to. Unfortunately the window doesn't stay open, it closes as soon as grep ceases printing the results of the grep. Does anyone know what to do to make the xterm stay open? TIA ---------------------------------------------------- Jonathan Wilson System Administrator Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
Hi, You could add the -hold option to xterm (see the man page): xterm -hold -e <command> Tim On Mon, Sep 10, 2001 at 01:31:57AM -0500, JW wrote:
#!/bin/bash xterm -fg black -bg white -e /usr/bin/sudo /sbin/ifconfig |grep "inet addr"
When I run this script, up pops a window that is asking for the user's password, just like it's supposed to. Unfortunately the window doesn't stay open, it closes as soon as grep ceases printing the results of the grep.
Does anyone know what to do to make the xterm stay open?
#!/bin/bash xterm -fg black -bg white -e /usr/bin/sudo /sbin/ifconfig |grep "inet addr"
When I run this script, up pops a window that is asking for the user's password, just like it's supposed to. Unfortunately the window doesn't stay open, it closes as soon as grep ceases printing the results of the grep.
Does anyone know what to do to make the xterm stay open?
TIA
I would try a look to xmessage. If you pipe the grep result to it its window remain open until they press Ok. I dont know if there is a better solution Tazio
On Mon, 10 Sep 2001, JW wrote:
Hello,
As part of my administration tasks I sometimes have to help remote users on who are dialing up there laptops while on trips to remote lands :-)
The big problem is always talking the user through giving me their IP address...
Click on the Konsole icon.... no, the one with the shell on it... type su - ... no, that's "s" as in sam, "u" as in user, space, dash... yes, it needs the root password... no not your password... ok now type exactly the letters I tell you... ifconfig |grep "inet "addr".... no that's "i" as in Internet, "f" as in frank...
You get my point. So I'm trying to write a script that will do everything except type their own password for them. It currently looks as follows:
#!/bin/bash xterm -fg black -bg white -e /usr/bin/sudo /sbin/ifconfig |grep "inet addr"
When I run this script, up pops a window that is asking for the user's password, just like it's supposed to. Unfortunately the window doesn't stay open, it closes as soon as grep ceases printing the results of the grep.
Does anyone know what to do to make the xterm stay open?
TIA
Never known ifconfig to require root priviledges, just the path. But you can enable the pause like this: /sbin/ifconfig |grep "inet addr" echo "press ENTER to continue..." read ans You may need to pull the xterm command out of the script and make a KDE desktop (or whatver WM) link and specify to run it in a terminal. Stew Benedict
At 06:29 AM 9/10/2001 -0400, you wrote:
On Mon, 10 Sep 2001, JW wrote:
Never known ifconfig to require root priviledges, just the path.
Well id' say you either don't use it very often, or have your permissions set to easy.local: jw@ccs008:~ > /sbin/ifconfig bash: /sbin/ifconfig: Permission denied
But you can enable the pause like this:
/sbin/ifconfig |grep "inet addr" echo "press ENTER to continue..." read ans
You may need to pull the xterm command out of the script and make a KDE desktop (or whatver WM) link and specify to run it in a terminal.
Well, that's not what I want to do, but I might need to anyway -thanks for the idea.
Stew Benedict
---------------------------------------------------- Jonathan Wilson System Administrator Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
participants (4)
-
JW
-
Praise
-
Stew Benedict
-
Tim van Venrooij