MacLahoriya
2009-06-27, 03:58
hi.....
i need your help to create a small script. i don't know scripting, and mostly copy/paste from net if i need something basic.
so the situation is that i have enabled Remote Access on my PowerBook (on LAN side) which is behind my Tomato router (ssh enabled on router). No open ports on the router so i think i am somewhat secure.
Now, if i get connect to internet through some other router I just want to remind myself to turn off the Remote Access. I plan to do this via GeekTool to display a message on my Desktop.
I have found that this terminal command
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I|grep BSSID|awk {'print $1 " "$2'}
does display the BSSID (MAC address) of the router you are connected to. But I don't know how to implement it in a script. I am sure it is very easy for someone who knows scripting. I have a basic sketch:
Check BSSID
if 00:00:00:00:00:0
then output text Connected to Tomato Router
if it is not 00:00:00:00:00:0
then output text NOT CONNECTED TO TOMATO ROUTER
(**if possible to add to above script, otherwise it is ok even without below part**
if airport is turned off
then Airport is INACTIVE)
I will be thankful for your help. i am not sure if it can be appleScript or shell-script to implement via GeekTool.
Cheers :)
i need your help to create a small script. i don't know scripting, and mostly copy/paste from net if i need something basic.
so the situation is that i have enabled Remote Access on my PowerBook (on LAN side) which is behind my Tomato router (ssh enabled on router). No open ports on the router so i think i am somewhat secure.
Now, if i get connect to internet through some other router I just want to remind myself to turn off the Remote Access. I plan to do this via GeekTool to display a message on my Desktop.
I have found that this terminal command
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I|grep BSSID|awk {'print $1 " "$2'}
does display the BSSID (MAC address) of the router you are connected to. But I don't know how to implement it in a script. I am sure it is very easy for someone who knows scripting. I have a basic sketch:
Check BSSID
if 00:00:00:00:00:0
then output text Connected to Tomato Router
if it is not 00:00:00:00:00:0
then output text NOT CONNECTED TO TOMATO ROUTER
(**if possible to add to above script, otherwise it is ok even without below part**
if airport is turned off
then Airport is INACTIVE)
I will be thankful for your help. i am not sure if it can be appleScript or shell-script to implement via GeekTool.
Cheers :)