{"id":727,"date":"2010-12-29T00:56:36","date_gmt":"2010-12-29T05:56:36","guid":{"rendered":"http:\/\/yourLinuxGuy.com\/?p=727"},"modified":"2010-12-29T14:21:03","modified_gmt":"2010-12-29T19:21:03","slug":"light-hearted-holiday-season-post-4","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=727","title":{"rendered":"Light-Hearted Holiday Season Post #4"},"content":{"rendered":"<p><em>In this time of chaos, tumult, and constant change, I&#8217;ve decided that  a little light-hearted Holiday Season levity is in order.\u00a0 With that in  mind, during this week of Christmas I&#8217;m posting a small series of  somewhat strange and superfluous oddities for your enjoyment, until I  come back to the regular posting schedule in 2011.\u00a0 Enjoy&#8230;\u00a0 And Happy  Holidays&#8230;<\/em><\/p>\n<p><strong>Sub-Title:\u00a0 The Mother-In-Law Script<\/strong><\/p>\n<p>Recently, my mother-in-law had some sort of a massive Windows-PC failure.\u00a0 I&#8217;m not sure what was wrong with it, but instead of trying to fix it, she decided she wanted to replace it with a borrowed PC that was lying around my house (on loan from another family friend).\u00a0 She worked out the finances with the owner, and went along her way.<\/p>\n<p>The interesting part here is that I had installed Opensuse 11.3 on this new-to-her PC, and she was fine with that.\u00a0 All she needed was a browser, really, and Firefox was already there&#8230;<\/p>\n<p>Once at her house, she couldn&#8217;t access the Internet, and she called her ISP support.\u00a0 Once she told them she was running Linux, they pretty much told her she was on her own.\u00a0 \ud83d\ude09<\/p>\n<p>To make a long story short, I got her back up and running (even with her favorite Google Chrome browser), but I soon realized I would probably need to be able to reach her new computer in the future to assist as she needed&#8230; &#8230;So I wrote this little script (below), and dropped it onto her user &#8220;Desktop&#8221;.<\/p>\n<p>This script, when run, basically re-names itself to reflect the DHCP address that the PC got from the ISP, and emails me the info as well.\u00a0 This way, Mother-In-law can see the IP address for herself without knowing any custom commands, and I get notified of the address (if the email can get through).\u00a0 If the machine is not properly networked, etc., then it obviously can&#8217;t email me, but the script name would at least reflect that, and she could tell me so.<\/p>\n<p>So here it is.\u00a0 Just copy the contents into a text file (this example is named &#8220;CheckAddress-64.299.2.23.sh&#8221;), change owner to the local user (&#8220;m-i-l&#8221; in my case), and flag as executable&#8230;\u00a0 Enjoy!<\/p>\n<pre><code>\r\n#\/bin\/bash\r\nMYFILE=\"$0\"\r\nMYADDR=`\/sbin\/ifconfig eth0 | grep \"inet addr\" | tr \":\" \" \" | awk '{ print $3 }'`\r\nNEWFILE=\"\/home\/m-i-l\/Desktop\/CheckAddress-$MYADDR\".sh\r\nmv $MYFILE $NEWFILE\r\nmailx -s \"Grandma is at $MYADDR\" jpavlov@yourlinuxguy.com &lt;&lt; EOF\r\nHere you go:\r\nOld name = $MYFILE\r\nNew name = $NEWFILE\r\nEOF\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this time of chaos, tumult, and constant change, I&#8217;ve decided that a little light-hearted Holiday Season levity is in order.\u00a0 With that in mind, during this week of Christmas I&#8217;m posting a small series of somewhat strange and superfluous&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=727\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[22],"tags":[],"class_list":["post-727","post","type-post","status-publish","format-standard","hentry","category-superfluous"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-bJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=727"}],"version-history":[{"count":5,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/727\/revisions"}],"predecessor-version":[{"id":742,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/727\/revisions\/742"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}