{"id":207,"date":"2010-07-19T21:56:29","date_gmt":"2010-07-20T01:56:29","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=207"},"modified":"2010-07-19T21:56:29","modified_gmt":"2010-07-20T01:56:29","slug":"wireless-in-powerbook-g4-part-2","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=207","title":{"rendered":"Wireless in Powerbook G4 part 2"},"content":{"rendered":"<p>Below is a small script to configure the network interfaces in the <a href=\"http:\/\/en.wikipedia.org\/wiki\/PowerBook_G4\" target=\"_blank\">Powerbook<\/a>. It will probably work in other <a href=\"http:\/\/www.kernel.org\" target=\"_blank\">Linux<\/a> systems too, maybe some modifications would need to be made. wlan0 is the wireless interface and eth0 the broadband interface.<\/p>\n<pre><b>\r\n#!\/bin\/bash\r\nPATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\r\n\r\necho \"Checking whether NetworkManager is running\"\r\nif [ -f \/var\/run\/NetworkManager.pid ]; then\r\n        echo \"NetworkManager is running, stopping it\"\r\n        \/etc\/init.d\/network-manager stop\r\nelse\r\n        echo \"NetworkManager is not running\"\r\nfi\r\n\r\nInterface() {\r\necho \"Choose the name of the interface you want to configure\"\r\necho \"1 = Interface ethernet eth0\"\r\necho \"2 = Interface wireless wlan0\"\r\necho \"0 = Quit the program\"\r\necho\r\nread INT\r\n\r\nif [ $INT = 1 ]; then\r\nETH=eth0\r\n\r\nelif [ $INT = 2 ]; then\r\nETH=wlan0 \r\necho \"Choose the essid you want to connect to\"\r\niwlist $ETH scan | grep -i essid\r\nread ESSID\r\niwconfig $ETH \"$ESSID\"\r\n\r\nelif [ $INT = 0 ]; then\r\necho \"Quitting\"\r\nexit 0\r\nfi\r\n}\r\n\r\nInterface\r\n\r\nConfigure() {\r\necho\r\necho \" 1 = static \"\r\necho \" 2 = dhcp \"\r\necho \" 0 to quit the program \"\r\necho\r\nread CHOICE\r\n\r\nstatic() {\r\necho \"Write the IP of the interface\"\r\nread IP\r\necho \"Write the network mask\"\r\nread NETMASK\r\necho \"Write the default gateway\"\r\nread ROUTE\r\necho \"Configuraning the interface\"\r\nifconfig $ETH $IP netmask $NETMASK\r\necho \"Configuraning the gateway\"\r\nroute add default gw $ROUTE\r\necho \"search\" > \/etc\/resolv.conf\r\necho \"Write the IP of the first DNS server\"\r\nread DNS_1\r\necho nameserver $DNS_1 >> \/etc\/resolv.conf\r\necho \"Write the IP of your second DNS server\"\r\nread DNS_2\r\necho nameserver $DNS_2 >> \/etc\/resolv.conf\r\n} \r\n\r\ndhcp() {\r\n        dhclient $ETH\r\n        }\r\n\r\nif [ $CHOICE = 1 ]; then\r\nstatic\r\n\r\nelif [ $CHOICE = 2 ]; then\r\ndhcp\r\n\r\nelif [ $CHOICE = 0 ]; then\r\necho \"Quitting the program.\"\r\nexit 0\r\nfi\r\n}\r\n\r\nConfigure\r\n\r\nexit 0\r\n<\/b><\/pre>\n<p>Suggestions are always welcome. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below is a small script to configure the network interfaces in the Powerbook. It will probably work in other Linux systems too, maybe some modifications would need to be made. wlan0 is the wireless interface and eth0 the broadband interface. #!\/bin\/bash PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin echo &#8220;Checking whether NetworkManager is running&#8221; if [ -f \/var\/run\/NetworkManager.pid ]; then echo [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[22,6,45,70,47,46],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-3l","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":0,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}