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
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?
Code:
ifconfig wlan0 | awk '{print substr($0, 11, 13)}'
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?