LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to application from script (http://www.linuxquestions.org/questions/linux-newbie-8/want-to-application-from-script-4175435195/)

jyotir.roy 11-02-2012 01:11 AM

want to application from script
 
Hi,

I have a script /etc/udev/rules.d/ra_insmod.sh and it's been run whenever I insert wifi dongle and insmod some .ko.
I have a application as /usr/sbin/wutil
I want to send parameter from this script this application.

vi /etc/udev/rules.d/ra_insmod.sh

/sbin/insmod /etc/Wireless/Ralink/rtutil3572sta.ko --> this is working
/usr/sbin/wutil EVENT PLUGIN --> this is not working

But it is working when I run manually from root

Can you help me to run wutil from ra_insmod.sh

shivaa 11-02-2012 06:23 AM

Quote:

vi /etc/udev/rules.d/ra_insmod.sh

/sbin/insmod /etc/Wireless/Ralink/rtutil3572sta.ko --> this is working
/usr/sbin/wutil EVENT PLUGIN --> this is not working
Do you mean, you have placed both insmod and wutil commands inside the script ra_insmod.sh, and want to invoke both using this script? If it is, then share that what error you're getting on line /usr/sbin/wutil EVENT PLUGIN?
Also did you try to debug this script using a set -xv? Once try it, as it will help you that where your script stuck. To me, it sounds some pb with permissions on wutil, but first you will need to do what's said above.

DutchGeek 11-02-2012 02:19 PM

Where did you declare the EVENT PLUGIN variable? did you declare it correctly?
I am not sure, but i think in bash variables should be with no space, e.g:
Code:

EVEN_PLUGIN = <something>
then when you refer to it, you should use a dollar sign:
Code:

/usr/sbin/wutil $EVENT_PLUGIN

jyotir.roy 11-04-2012 07:37 PM

want to application from script
 
Hi All,

Thanks for your valuable input.

Now it's working. I need to give full path of the application where it's been stored.

/usr/sbin/wutil EVENT PLUGIN

Thanks Again.


All times are GMT -5. The time now is 11:58 AM.