LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   execute bash script with new terminal without give the password ... (https://www.linuxquestions.org/questions/linux-newbie-8/execute-bash-script-with-new-terminal-without-give-the-password-4175469052/)

mythcat 07-09-2013 04:40 PM

execute bash script with new terminal without give the password ...
 
I try to execute this script:
Code:

#!/bin/sh
lxterm -e "watch -d ifconfig eth0"

1.The problem when start the new lxterm this need the su password.

I try with visudo to edit :

Code:

ALL=(usertest) NOPASSWD: /home/usertest/watch_ifconf.sh
result is :
Code:

sh: 1: ifconfig: not found
2.I want to use many terminals in same desktop and need to see all.
How can I do ?
Thank's . Regards.

Firerat 07-09-2013 05:51 PM

The full path to ifconfig should help you out
Code:

lxterm -e "watch -d /sbin/ifconfig eth0"
And you shouldn't need root to execute that. You would only require root if you wanted to change something like the IP/Netmask or State ( UP/DOWN )

Rather than starting multiple terminals and arranging, something I use which may or may not suit your needs is Terminator

With a little work you can setup profiles. Allowing the start of multiple terminal sessions each automatically executing commands/scripts all in one Window with multiple panes.


All times are GMT -5. The time now is 09:57 AM.