- This topic has 4 replies, 3 voices, and was last updated Oct 7-8:54 am by Vincent17.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Forum for users of antiX Linux. Mean and Lean and Proudly anti-fascist.
Forum › Forums › New users › New Users and General Questions › iwgetid in script returns "" [solved]
I have a startup script that needs to know when I’m on home wifi. I use [[ $(iwgetid -r) = "my ssid" ]] && a=home || a=away
This works on a command line or if the script is run from a terminal, but if the script is run by clicking its icon, or in my case, from .jwm/Startup, then $(iwgetid) returns “” and always a=away. Can someone explain what’s going on?
antiX-17.3.1_386-base Helen Keller 27 December 2018
rox/jwm (just like Puppy 🙂
P.S. I ask here, not on StackExchange because this script works as expected in MX, puppy and a couple of others.
iwconfig, ifconfig behave the same way.
This works:
[[ $(/sbin/iwgetid -r) = "my ssid" ]] && a=home || a=away
Would still appreciate an explanation
Is sbin in $PATH? (type $PATH in a terminal)
Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
Generally /sbin contains “system” commands and isn’t in user’s paths, and shouldn’t be, but is in root’s path. Rather than adding it to your path, it’s best to just fully qualify the command if running as a user.
Is sbin in $PATH?
Yes.
it’s best to just fully qualify the command
lesson learned!
Thanks.
EDIT: test.sh contains xmessage $PATH
$ ./test.sh yields /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
click on icon yields /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
??
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |