{"id":24,"date":"2006-01-16T18:40:57","date_gmt":"2006-01-16T23:40:57","guid":{"rendered":"http:\/\/raffy.ch\/blog\/?p=24"},"modified":"2006-01-16T18:40:57","modified_gmt":"2006-01-16T23:40:57","slug":"wireless-access-linux","status":"publish","type":"post","link":"https:\/\/raffy.ch\/blog\/2006\/01\/16\/wireless-access-linux\/","title":{"rendered":"Wireless Access &#8211; Linux"},"content":{"rendered":"<p>Sitting down at a cafe around the corner from where I live, I realize that some of the scripts I wrote a while back might actually benefit others too. This one is to connect to the first available access point:<\/p>\n<p><code>#!\/bin\/bash<\/p>\n<p>iwlist ath0 s > \/tmp\/$$<\/p>\n<p>ap=`cat \/tmp\/$$ | grep \"Encryption key:off\" -B 5 | head -1 | sed -e 's\/Cell.*Address: \\(.*\\)\/\\1\/g'`<br \/>\nessid=`cat \/tmp\/$$ | grep \"Encryption key:off\" -B 4 | head -1 | sed -e 's\/ESSID:\"\\(.*\\)\"\/\\1\/g'`<br \/>\nessid=`echo $essid | sed -e 's\/ \/\/g'`<\/p>\n<p>echo Tryping AP:$ap \/ SSID:$essid<\/p>\n<p>iwconfig ath0 ap $ap<br \/>\niwconfig ath0 essid $essid<br \/>\niwconfig ath0 nick test<br \/>\nkillall -9 dhclient<br \/>\ndhclient ath0<br \/>\n<\/code><\/p>\n<p>Not sure whether there would be a simpler solution natively supported by linux&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sitting down at a cafe around the corner from where I live, I realize that some of the scripts I wrote a while back might actually benefit others too. This one is to connect to the first available access point: #!\/bin\/bash iwlist ath0 s > \/tmp\/$$ ap=`cat \/tmp\/$$ | grep &#8220;Encryption key:off&#8221; -B 5 | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-unix-scripting"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":0,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"wp:attachment":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}