• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Secure settings and run command

lotus49

Android Expert
May 9, 2011
1,513
232
Yorkshire
I am trying to get my S4's IP address using Tasker. The Secure Settings plugin allows me to run a Linux command so I have set it up to run this command

Code:
ifconfig wlan0 | awk '{print substr($0, 11, 13)}'
The command works fine at the command line and if I turn on the Show Output and Show Notification check boxes I get the output I expect.

Just in case there are any other Unixers reading this I know cut would have been simpler than awk but it didn't work. I also know this command assumes that the IP address will necessarily be 13 chars long when it won't always be - I'll sort these issues out later.

The only variable I have set in Secure Settins is %IPADDR which is set as the Output Variable. However, after I run the command, this variable has no value, whereas I expected it to include the output of the above command ie my IP address.

Does anyone know what I am doing wrong?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones