{"id":946,"date":"2015-02-17T15:33:00","date_gmt":"2015-02-17T20:33:00","guid":{"rendered":"https:\/\/www.softwareab.net\/wordpress\/?p=946"},"modified":"2015-02-17T15:33:00","modified_gmt":"2015-02-17T20:33:00","slug":"centos-wireless-fix-when-it-breaks","status":"publish","type":"post","link":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/","title":{"rendered":"CentOS Wireless: Fix when it breaks!"},"content":{"rendered":"<p>Hi All &#8211; if you have ditched NetworkManager (as I have) and you are still running into wireless LAN access problems&#8230;check out this script!<\/p>\n<p><!--more--><\/p>\n<p>I am in quite a rush so no time to explain the script&#8230;but check out the commands (and the order of the commands) and Enjoy \ud83d\ude42<\/p>\n<p>You must already have <code>wpa_supplicant<\/code> configured properly for these commands to work.<\/p>\n<pre><code>\r\n#!\/bin\/bash\r\n# 20150217, ABr: Updated to have extensive additional code for wireless update\r\n\r\nl_process=1\r\nif ip a show wlan0 | grep --quiet -e \"inet [0-9]\\+\\.\" 2>\/dev\/null; then\r\n  echo \"Looks like you already have a wireless IP. Is there a problem?\"\r\n  l_process=0\r\nfi\r\n\r\nl_fixed=1\r\nif [ $l_process -eq 1 ]; then\r\n  l_fixed=0\r\n\r\n  # first, bring everything down\r\n  sudo service network stop\r\n\r\n  # next, unblock wifi\r\n  sudo rfkill unblock wifi\r\n\r\n  # bring up the network\r\n  sudo service network start\r\n\r\n  # do we have an IP?\r\n  if ip a show wlan0 | grep --quiet -e \"inet [0-9]\\+\\.\" 2>\/dev\/null; then\r\n    echo \"Wireless IP network found; we win.\"\r\n    l_fixed=1\r\n  else\r\n    echo \"No IP network found, bouncing wifi...\"\r\n    sudo ifdown wlan0\r\n    # wait to give wifi time to initialize\r\n    sleep 3\r\n    sudo ifup wlan0\r\n\r\n    # final check\r\n    if ip a | grep --quiet -e \"inet 192\" 2>\/dev\/null; then\r\n      echo \"IP network found; victory!\"\r\n      l_fixed=1\r\n    else\r\n      echo \"IP network not created, going for Round 2.\"\r\n    fi\r\n  fi\r\nfi\r\n\r\nif [ $l_fixed -eq 0 ]; then\r\n  echo \"So the wireless thinks it won't work, eh?\"\r\n  echo \"Time for the heavy artillery.\"\r\n  echo \"Firing all salvos!\"\r\n  echo \"  Stop the network (again)...\"\r\n  service network stop >\/dev\/null 2>&1\r\n  echo \"  Killing all wpa_supplicant instances...\"\r\n  l_wpas=$(ps -efa | grep wpa | grep -v grep | sed -e 's# \\+# #g' | cut -d' ' -f 2)\r\n  for i in $l_wpas; do\r\n    kill -9 $i\r\n  done\r\n  echo \"  Starting the network...\"\r\n  service network start >\/dev\/null 2>&1\r\n  echo \"  Force wireless down...\"\r\n  ifdown wlan0\r\n  echo \"  Unblock wireless...\"\r\n  rfkill unblock all\r\n  echo \"  Forcing the wireless card up...\"\r\n  ifconfig wlan0 up\r\n  echo \"  Forcing wpa_supplicant to start...\"\r\n  wpa_supplicant -iwlan0 -c\/etc\/wpa_supplicant\/wpa_supplicant.conf  -Dwext &\r\n  echo \"  Forcing IP address...\"\r\n  ifup wlan0\r\n  if ip a | grep --quiet -e \"inet 192\" 2>\/dev\/null; then\r\n    echo \"IP network found; victory!\"\r\n  else\r\n    echo \"No IP network, track down Andy again.\"\r\n  fi\r\nfi<\/code><\/pre>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All &#8211; if you have ditched NetworkManager (as I have) and you are still running into wireless LAN access problems&#8230;check out this script!<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,81,1],"tags":[42,55,19,22,18],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CentOS Wireless: Fix when it breaks! - softwareab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CentOS Wireless: Fix when it breaks! - softwareab\" \/>\n<meta property=\"og:description\" content=\"Hi All &#8211; if you have ditched NetworkManager (as I have) and you are still running into wireless LAN access problems&#8230;check out this script!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\" \/>\n<meta property=\"og:site_name\" content=\"softwareab\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cloudraticsolutions\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/cloudraticsolutions\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-17T20:33:00+00:00\" \/>\n<meta name=\"author\" content=\"Andrew Bruce\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@realcloudratics\" \/>\n<meta name=\"twitter:site\" content=\"@realcloudratics\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Bruce\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\"},\"author\":{\"name\":\"Andrew Bruce\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"headline\":\"CentOS Wireless: Fix when it breaks!\",\"datePublished\":\"2015-02-17T20:33:00+00:00\",\"dateModified\":\"2015-02-17T20:33:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\"},\"wordCount\":69,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"keywords\":[\"centos\",\"linux\",\"network\",\"scripting\",\"sysadmin\"],\"articleSection\":[\"Network\",\"SysAdmin\",\"Teknocratica\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\",\"name\":\"CentOS Wireless: Fix when it breaks! - softwareab\",\"isPartOf\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#website\"},\"datePublished\":\"2015-02-17T20:33:00+00:00\",\"dateModified\":\"2015-02-17T20:33:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.softwareab.net\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"centos\",\"item\":\"https:\/\/www.softwareab.net\/wordpress\/tag\/centos\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CentOS Wireless: Fix when it breaks!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#website\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/\",\"name\":\"softwareab\",\"description\":\"Technocratica, Technopolitik, Technophobia\",\"publisher\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.softwareab.net\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\",\"name\":\"Andrew Bruce\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg\",\"contentUrl\":\"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg\",\"width\":400,\"height\":330,\"caption\":\"Andrew Bruce\"},\"logo\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/\"},\"description\":\"Team-oriented systems mentor with deep knowledge of numerous software methodologies, technologies, languages, and operating systems. Excited about turning emerging technology into working production-ready systems. Focused on moving software teams to a higher level of world-class application development. Specialties:Software analysis and development...Product management through the entire lifecycle...Discrete product integration specialist!\",\"sameAs\":[\"http:\/\/cloudraticsolutions.net\/\",\"https:\/\/www.facebook.com\/cloudraticsolutions\/\",\"https:\/\/twitter.com\/realcloudratics\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CentOS Wireless: Fix when it breaks! - softwareab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/","og_locale":"en_US","og_type":"article","og_title":"CentOS Wireless: Fix when it breaks! - softwareab","og_description":"Hi All &#8211; if you have ditched NetworkManager (as I have) and you are still running into wireless LAN access problems&#8230;check out this script!","og_url":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/","og_site_name":"softwareab","article_publisher":"https:\/\/www.facebook.com\/cloudraticsolutions\/","article_author":"https:\/\/www.facebook.com\/cloudraticsolutions\/","article_published_time":"2015-02-17T20:33:00+00:00","author":"Andrew Bruce","twitter_card":"summary_large_image","twitter_creator":"@realcloudratics","twitter_site":"@realcloudratics","twitter_misc":{"Written by":"Andrew Bruce","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#article","isPartOf":{"@id":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/"},"author":{"name":"Andrew Bruce","@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"headline":"CentOS Wireless: Fix when it breaks!","datePublished":"2015-02-17T20:33:00+00:00","dateModified":"2015-02-17T20:33:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/"},"wordCount":69,"commentCount":0,"publisher":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"keywords":["centos","linux","network","scripting","sysadmin"],"articleSection":["Network","SysAdmin","Teknocratica"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/","url":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/","name":"CentOS Wireless: Fix when it breaks! - softwareab","isPartOf":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#website"},"datePublished":"2015-02-17T20:33:00+00:00","dateModified":"2015-02-17T20:33:00+00:00","breadcrumb":{"@id":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.softwareab.net\/wordpress\/centos-wireless-fix-when-it-breaks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.softwareab.net\/wordpress\/"},{"@type":"ListItem","position":2,"name":"centos","item":"https:\/\/www.softwareab.net\/wordpress\/tag\/centos\/"},{"@type":"ListItem","position":3,"name":"CentOS Wireless: Fix when it breaks!"}]},{"@type":"WebSite","@id":"https:\/\/www.softwareab.net\/wordpress\/#website","url":"https:\/\/www.softwareab.net\/wordpress\/","name":"softwareab","description":"Technocratica, Technopolitik, Technophobia","publisher":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.softwareab.net\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600","name":"Andrew Bruce","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg","contentUrl":"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg","width":400,"height":330,"caption":"Andrew Bruce"},"logo":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/"},"description":"Team-oriented systems mentor with deep knowledge of numerous software methodologies, technologies, languages, and operating systems. Excited about turning emerging technology into working production-ready systems. Focused on moving software teams to a higher level of world-class application development. Specialties:Software analysis and development...Product management through the entire lifecycle...Discrete product integration specialist!","sameAs":["http:\/\/cloudraticsolutions.net\/","https:\/\/www.facebook.com\/cloudraticsolutions\/","https:\/\/twitter.com\/realcloudratics"]}]}},"_links":{"self":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/946"}],"collection":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/comments?post=946"}],"version-history":[{"count":1,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/946\/revisions"}],"predecessor-version":[{"id":947,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/946\/revisions\/947"}],"wp:attachment":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/media?parent=946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/categories?post=946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/tags?post=946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}