External IP change notification

Having dynamic IP addressing from your Internet Provider (ISP) could give you some trouble; especially when you need to remotely accessing machines;

I had to write a little script that regulary based checks my external IP; And if it change then sending to me an email.
Schedule it into your crontab and you are done.

Below, the script :

 

 

#!/bin/bash

###########################################
# script that check your external IP address
# if the one has changed to compare with the provious one
# and an email is generated and sent; Otherwise nothing.
#
# Nicolas.B - 04032013
##########################################
#
# File log used locally : myip.log 
#
#
#
############
# variables

mailfrom="sender_adressemail@domain.com"
rcpt="recipient_adressemail@domain.com"
subject="My external IP"
###########


############################
# check if wget is present

command -v wget >/dev/null 2>&1 || { echo "I require wget but it's not installed. Aborting." >&2; exit 1; }
command -v mail >/dev/null 2>&1 || { echo "I require mail but it's not installed. Aborting." >&2; exit 1; }

##########
# retrieve my external ip

wget --default-page=checkip.html http://checkip.dyndns.com/ 2>1 /dev/null
check=$(cat checkip.html | awk '{print $6}'|cut -d"<" -f1) if [ -f myip.log ]; then readip=$(cat myip.log) else wget http://checkip.dyndns.com/ 2>1 /dev/null
cat checkip.html | awk '{print $6}'|cut -d"<" -f1 > myip.log
readip=$(cat myip.log)
fi

###########

if [ "$check" = "$readip" ]; then 
echo ""
echo "this is the same IP: $check"
echo "email not sent to $rcpt"
echo ""
else

wget http://checkip.dyndns.com/ 2>1 /dev/null
cat checkip.html | awk '{print $6}'|cut -d"<" -f1 > myip.log


###########
# send the email
mail -r $mailfrom -s "$subject" $rcpt < myip.log

fi


if [ -f checkip.html ]; then
rm checkip.html
else
echo ""

fi

0 Replies to “External IP change notification”

  1. cheap car insurance
    Seguros qualitas mexico ( Video
    Qualitas Compania de Seguros, S Seguros qualitas mexico Qualitas Compania de Seguros, S.A.B. de C.V. ?Compartido! Se ha compartido el contenido, si desea compartir este contenido con otros usuarios haga clic aqui. Ha ocurrido un error, le pedimos intentarlo nuevamente. Acceso Directo: Descripcion Informacion de Compania Contactos Clave Accionistas Subsidiarias Noticias Relacionadas Descripcion Empresas de capitales privados, capitales abiertos y propiedad estatal Firmas internacionales, regionales y locales Accionistas y filiales, socios de riesgo compartido y consorcios Operadores, contratistas y proveedores de equipos Organismos de gobierno y reguladores 50.000 contactos del mas alto nivel Busqueda personalizada de contactos para descubrir sus …
    The post Seguros qualitas mexico ( Video appeared first on Auto&Car.

    Fitness News

  2. donate your car
    When was kansas made a state / Video
    When was kansas made a state When was kansas made a state College Funding in Kansas Programs to Help You Pay for Your Education Kansas continues its strong academic tradition at noted state schools like Bethel College, University of Kansas, Kansas State, Wichita State and others. The Kansas State university system is comprised of six state university campuses, one municipal university, 19 community colleges and nearly a dozen technical institutions. To support access to higher education among state residents, the Kansas Board Of Regents administers a formidable stable of state-funded scholarships and grants. Kansas college students earn state-backed financial aid …
    The post When was kansas made a state / Video appeared first on Auto.

    Lexingtone Business
    absenteeism
    auto
    international
    afg 5.1 at treadmill review
    Site

  3. bennett auto supply

    Where is indiana university bloomington + Video
    Indiana University (IU) – Bloomington Salary, PayScale Where is indiana university bloomington Indiana University (IU) – Bloomington Average Salary Indiana University is a university based in Bloomington, Ind. that is home to around 41,000 undergraduates. Much of campus life revolves around sports (Go Hoosiers!), and the urban location lets student freely explore the diverse, interesting city at their fingertips. Figures cited in this summary are based on graduates’ replies to PayScale’s salary questionnaire. College ROI Report 20 Year Net ROI Total 4 Year Cost College Salary Report Early Career Salary Indiana University (IU) – Bloomington Median Salary by Job Currency: …
    The post Where is indiana university bloomington + Video appeared first on Health .

    Lesotho Business
    BONUS 100 FREE DOFOLLOW Links SITE

    http://dburn.ru/users/REMONTPoef
    http://www.ezcooking.me/listing/arguments-virginia-beach-finance-fresh-news-remmont-com/?newcomment=1
    http://krevetka.in.ua/blog/dlia-klientov/
    http://spb-endo.ru/cons/messages/forum2/topic20/message2139/
    http://gsm-fan.ru/blog/nuzhen-li-chehol

    http://www.alcazarfilms.com/los-dichos-gitanos-de-jerez/?unapproved=23620&moderation-hash=b421cd107e8c66699975a567d0f29c34#comment-23620
    http://repurposedandrefined.com/lets-get-creative/?unapproved=82061&moderation-hash=332227787227150c6ad21513cc75467a#comment-82061
    http://happydaysoutofschoolcare.co.uk/2013/07/gallery-post/?unapproved=10582&moderation-hash=2ff4906c15a0753bba114af7054c66d6#comment-10582
    http://blog.jordanian.ws/travel-to-jordan/a-guide-to-living-in-jordan/?unapproved=265833&moderation-hash=17e725598e9bc893422e7206cb1bb291#comment-265833
    https://travelling-in-asia.info/gambling-in-asia/?unapproved=42147&moderation-hash=a4c36ad5780540b466a8f33521e33528#comment-42147
    https://thinkcopper.org/architecture/travels-with-larry-new-york-city/?unapproved=20865&moderation-hash=dfcfec5e2ecdde92d23b5cd445bf2e90#comment-20865
    http://askesis.us/how-can-i-protect-my-carpet/?unapproved=1407&moderation-hash=618e8bba39c126d7f289b4a283823f00#comment-1407
    http://www.christinagranahan.com/blog/thank-you-note-challenge-january-2019/?unapproved=4730&moderation-hash=98c4be139a9d6e78a68cc157692d70a1#comment-4730
    http://redcupsports.com/cousins-league-recap-week-three/?unapproved=95838&moderation-hash=65e90e9e1d92fed30aeeacab890523ea#comment-95838
    http://forklaede.com/forklaeder/?unapproved=194439&moderation-hash=0afc8e0ca5f9158fbf98694e765a78aa#comment-194439
    http://hungriest.es/sample-page/?unapproved=22838&moderation-hash=6251030d81e3eb0c6115fa3dc675d439#comment-22838
    http://www.akikuvaa.com/foorumi/?unapproved=50189&moderation-hash=7310573b87a981a137c61c18a901cb0c#comment-50189
    http://www.escolanuriavilella.com/pfi/?unapproved=1074&moderation-hash=01592c62fb95d5923cd2e2b4693e4d99#comment-1074
    https://careerknacks.com/november-visa-bulletin/?unapproved=25596&moderation-hash=50e31ebe7bb07602744b1b2323d0eff1#comment-25596
    http://mixxbook.com/painting-your-universe-with-the-bold-stroke-of-purpose/?unapproved=89951&moderation-hash=66f2ed811003cb06216668d6ab4f9b10#comment-89951
    https://libbabray.com/miles-and-miles-of-no-mans-land/?unapproved=58180&moderation-hash=cc321c3bcd2049f4122416a2c95aba08#comment-58180
    http://www.grabemployment.com/central-pollution-control-board/?unapproved=75181&moderation-hash=210b9e91899e956688c2e698b74a34db#comment-75181
    http://nutritionways.org/2012/11/28/blogs-to-follow/?unapproved=1002&moderation-hash=6fac471c884c5433284a1f23589e2cf4#comment-1002
    https://fitnick.com/do-you-know-your-sunscreen-2/?unapproved=30072&moderation-hash=0024ae392f72cb7358053405f517fb28#comment-30072
    http://roi-concepts.com/hello-world/?unapproved=15601&moderation-hash=ed383b71879a1312a9f5f1512cc6ca95#comment-15601
    http://iddahockey.no/u11-pa-forstereis-turne-til-ostlandet/?unapproved=1098&moderation-hash=522f3cd655fe8ab0f78539704b522b79#comment-1098
    http://www.xn--meinbullerb-3hb.de/?page_id=2&unapproved=17980&moderation-hash=1d513849c8f4f9ed443e648009d7b02d#comment-17980
    http://loi-internet.org/how-small-business-owners-can-succeed-at-seo/?unapproved=24253&moderation-hash=626b02bb5e0c3d1476ae378f1a2d9403#comment-24253
    http://www.real-estate-at-whistler.com/buying/understanding-closing-costs/?unapproved=2375&moderation-hash=a26268534b36994c46f7afb6d6e8da4f#comment-2375
    http://gavleit.com/heathrow-escorts-take-pleasure-in-fantastic-time/?unapproved=11236&moderation-hash=cd7c469aafd55cb43d00c94c4fae7655#comment-11236
    http://www.sneakershop.club/2018/11/09/fear-the-garbage-disposal-or-just-call-a-plumber/?unapproved=55062&moderation-hash=5322ee91bf8b18857c294ae788d845e6#comment-55062
    http://eyva.com.pl/en/2018/06/25/viatrix-episode-2-iceland-esja/?unapproved=26571&moderation-hash=9bbf47478563f07fe8045c47cf87b5b4#comment-26571
    http://tataref.com/2018/04/04/hello-world/?unapproved=14823&moderation-hash=066f6363446b650509bc57b5e64cd5b4#comment-14823
    http://www.fitnesscamp.co/joint-n11-review/?unapproved=18203&moderation-hash=2bda77ba1b8104d1e6158805467cbe22#comment-18203
    http://enza.ca/therapies.html?unapproved=3050&moderation-hash=b58b452e22fb6b29bcbd87046515e82b
    https://kotle.eu/automaticky-kotel-prosat/20-6/?unapproved=685&moderation-hash=27937270579df0172d0674800b82e5ae#main/#comment-685
    http://www.vivilevalli.it/arte-e-culturalungolivigno-e-il-terzo-paradiso/?unapproved=37389&moderation-hash=97c391250836a37fd360170a7aed8ab8#comment-37389
    http://www.vfroofing.com/news/velcheck-finger-named-a-2012-fastest-growing-firm/?unapproved=23045&moderation-hash=325ec9049ae23dd57cae82349e03135d#comment-23045
    http://www.chefcrybaby.com/?p=7961&unapproved=33465&moderation-hash=8a66c1d7118d70810bb5911507bac105#comment-33465
    http://ditlab.ru/blog/sozdanie-razreza-secheniya-v-kompas-3d/?unapproved=696&moderation-hash=28e4cef1e4e97a98df04b0d00b6e86e3#comment-696
    http://queryhorse.com/forums/showthread.php?6571-quick-auto&p=7853#post7853
    http://www.skupina-gadi.com/video/draga-povej-2/?unapproved=531228&moderation-hash=349ea19e0601f8dd5a6eaa1eea09b0cd#comment-531228
    http://www.concordtimes.com.ng/news/economist-magazine-denies-story-nigeria/?unapproved=6976&moderation-hash=6db09bdac1f1dad3da7d477d2222ba96#comment-6976
    https://thefashionobserver.com/4-strategic-steps-to-build-seo-in-google/?unapproved=30763&moderation-hash=715c3ce707842de4c065f1dfcf14cacc#comment-30763
    https://rumydom.ru/stolbchatyj/monolitnyj-stolbchatyj-fundament.html?unapproved=8379&moderation-hash=7ff493f28dab6f657c4bf0426911a410#comment-8379
    http://www.nickwolny.com/emailguideblog/?unapproved=7863&moderation-hash=56d4c906ceaf143eb86113b09b0dfb62#comment-7863
    https://radioidealomate.net/contactos/?unapproved=2453&moderation-hash=4d31a2d4693a9719776d1a3f67572a05#comment-2453
    http://joyiaessentials.com/product/maia/?unapproved=3226&moderation-hash=475dc57ef393086faae076e5fd93bb18#comment-3226
    http://www.mftrainingblog.com/2017/11/30/look-inward-thats-the-answer/?unapproved=5472&moderation-hash=53712b514afcea1e79b0377f85c0b063#comment-5472
    http://failingsuccessfully.com/wwe-wrestlemania-33-recap/?unapproved=9333&moderation-hash=d70b2c3897241bfa33ef3a3735f44f97#comment-9333
    http://citizenscongress.us/citizensblog/?unapproved=239671&moderation-hash=8837656f124c6b8d5a78a2b5f290d163#comment-239671
    https://drones.amaraq.com/featured-article/drone-helicopters/?unapproved=5626&moderation-hash=842bb7ef44f27e69f496276472d9e932#comment-5626
    http://kabitaskitchen.com/traditional-raw-mango-pickle-aam-ka-achar/?unapproved=89764&moderation-hash=f3f742dffe445d3cc7331fa78e9389c5#comment-89764
    http://www.finance-insurance-legal.com/guest-blogging-guidelines/?unapproved=43147&moderation-hash=fd9e3a4d2e67e47ac0cf3a13b2f06e16#comment-43147
    http://broads-online.com/highres2075686-5/?unapproved=20538&moderation-hash=80712df19eb46a3cbb2e6b94cdda4d60#comment-20538
    http://migrantviews.co.nz/run-mohan-run-we-like-you/?unapproved=21617&moderation-hash=6154d8c8dffd921a6ee5a74f590659cf#comment-21617
    http://www.myrealty.org/uncategorized/hello-world/?unapproved=18507&moderation-hash=0c9363668a5f7b8fa2b3048345a38fe6#comment-18507
    https://pdxpeople.com/portland-oregon-becomes-first-city-tackle-ceo-pay/?unapproved=17346&moderation-hash=09e193694821404e72c29d90dde26bd5#comment-17346
    https://allesmetbitcoin.nl/psn-card/playstation-tegoed-kopen-met-bitcoin/?unapproved=19764&moderation-hash=03045da89127d6a875fa9dcefb86ade1#comment-19764
    http://surveillancecampro.com/2015/09/vestibulum-risus-nulla/?unapproved=44095&moderation-hash=562696c564d4626809573c5f9da55a49#comment-44095
    http://www.jarrupalat.fi/expansion-of-an-enterprise-suitable-new-area-or-2/?unapproved=30402&moderation-hash=c9fa9fe3d945c7c151479e9ca1177f2a#comment-30402
    http://vivekkrishnan.com/wedding-albums/?unapproved=187308&moderation-hash=d60da12d40b5ec5456fe45fc03ceb304#comment-187308
    http://30daychallengeaccepted.com/list-of-challenges/?unapproved=22490&moderation-hash=39d6b183db5613c257232223fef0cbb1#comment-22490
    https://telesexo.gratis/comment-page-1/?unapproved=21722&moderation-hash=bb4a4753d8227106ca594218556b916f#comment-21722
    http://www.wellnessgalax.com/chocolate-slim/?unapproved=169698&moderation-hash=d5477c6ed754ebf8dfacb43191829ada#comment-169698
    https://www.beautycollege.asia/great-tips-to-help-you-look-your-very-best/?unapproved=14472&moderation-hash=0041747902452e36ece0e920fc5e148e#comment-14472
    http://innodia.co.id/projects/project-theta?unapproved=11852&moderation-hash=320d5939e8d2945d267b351e2053e01a#comment-11852
    http://mobflint.com/?unapproved=1575&moderation-hash=0705f58297ef36180a7d3448ff4677d3#comment-1575
    http://hellemay.com/2009/11/12/celtic-knots/?unapproved=62843&moderation-hash=6a1bd8a435632f82cdab015bd18a38ba#comment-62843
    http://skolespring.dk/udskiftning-af-stroemadaptere-til-ipads/?unapproved=11380&moderation-hash=e7e24bcb06388590f6b7a75354eb8e0f#comment-11380
    https://carvinmenssalon.co.uk/team_5/?unapproved=32327&moderation-hash=3d121fc5e70a8d310acb0d71225a8b78#comment-32327
    http://coppercorsica.com/?page_id=2&unapproved=5276&moderation-hash=9c2c3357ec22e681a9fad163ba43c03e#comment-5276
    http://disneytips.net/2017/07/disney-world-facts-you-never-knew/?unapproved=257645&moderation-hash=47e73a8d841a7d0f5b1dff46e496d016#comment-257645
    http://christophercrane.com/online-art-store-opening/?unapproved=58680&moderation-hash=eb98859b1296ad9296be34bc8a9e9490#comment-58680
    https://kathiekerler.com/my-favorites-from-the-iqa-houston/?unapproved=22556&moderation-hash=8ced87f62e6c38c4b4fba34f82cb8cb5#comment-22556
    http://www.delamico.com/?unapproved=24396&moderation-hash=af72f9b664a4e4eb4d8c92baee81723b#comment-24396
    https://alunoonline.club/portal-do-aluno-online-ufam/?unapproved=8011&moderation-hash=ffeeecd32124e5bac8d6e95f9895d9fd#comment-8011
    http://newcarrierauthority.com/sample-post/?unapproved=7246&moderation-hash=4c62fb32c7153a86512b29bc628464f6#comment-7246
    https://www.bigdoctors.com/doktorumuzu-secerken-nelere-dikkat-etmeliyiz/?unapproved=7043&moderation-hash=6e9618ae47d812e9fe1d61dcd2d8a1f6#comment-7043
    https://groupe-partem.com/10-ways-to-design-for-the-human-brain/?unapproved=5349&moderation-hash=e6fcfdee7b9f69e2c18264092d931dd8#comment-5349
    http://arsradio.com.ve/index.php/jewelry-collection/item/550-albert-einstein
    http://firmadigitalizada.net/principio/?unapproved=41381&moderation-hash=cf0c30d84c04684674e29bc4f9b05033#comment-41381
    http://www.moderatefantasyviolence.com/mfv-2-better-call-bob-messiah/?unapproved=45327&moderation-hash=3881a50d1133b2cf77ca6ec0cff186d9#comment-45327
    http://bjpconsult.net/2015/05/04/hello-world/?unapproved=21951&moderation-hash=299ede94b4c5395664d54596b790ea75#comment-21951
    http://wolf.s58.xrea.com/etc/etc20.htm
    http://www.revvrstudios.com/questcast?unapproved=16834&moderation-hash=c2d7f2a1b236458284a58f8c893e16d7#comment-16834
    http://www.perlphpasp.com/which-seo-company-is-safe-and-competent/?unapproved=20511&moderation-hash=c4ac24f556ad041e6b2143c4668c64c1#comment-20511
    http://imgatevisual.com/index.php/2015/12/30/hello-world/?unapproved=17962&moderation-hash=c9e00be79279eb3b8259180ce741718f#comment-17962
    http://quadsworth.com/2015/01/change/?unapproved=32520&moderation-hash=ec15f9998d0d8233deff3b5223a7bf45#comment-32520
    http://guiacadizweb.com/de-copas-en-cadiz/?unapproved=14478&moderation-hash=78f6096da2877759d87c13737cd94c3b#comment-14478
    http://www.parkconsult.co.uk/2015/05/27/welcome-to-park-consult/?unapproved=23591&moderation-hash=d26e0ec6d5c3d5805058efd1c6c8bbec#comment-23591
    http://alarmsysteeminformatie.nl/verzekeringseis-voor-uw-alarmsysteem/?unapproved=28949&moderation-hash=cd0deb7d7b353fadece10b10c5a26007#comment-28949
    http://tyrannosaur.org/?p=4&unapproved=14825&moderation-hash=84514ee23eb3a165648ba0d19b48d5a4#comment-14825
    http://caribbeanpalmtempe.com/hello-world/?unapproved=7233&moderation-hash=20a422460a442cd8a6f98bd3c5f627ed#comment-7233
    https://poisedcreatures.com/music-is-emotional-manipulation/?unapproved=6644&moderation-hash=c5cd9f1d3f0c1ec840d3f57544f63ebd#comment-6644
    http://abolinhoview.com/2016/06/23/236-confira-as-estreias-do-cinema/?unapproved=60416&moderation-hash=75cd201791b810b26440d3767a9174dd#comment-60416
    http://cultures.cz/numbeo-zjistete-si-kolik-stoji-zivot-cizine/?unapproved=5064&moderation-hash=95afe4055e16dbcbfd89cdb2f101ca17#comment-5064
    https://king.brainstormforce.com/post-format-gallery/100_5540/?unapproved=32357&moderation-hash=5900b947aff9f6d445676921660fcfa3#comment-32357
    http://altfilmz.com/sample-page/?unapproved=23464&moderation-hash=8b1d609e1eebe5e547d08dd5795f3f2e#comment-23464
    http://gsmboard.ru/poleznye-sovety/kak-pravilno-vybrat-operatora.html?unapproved=6063&moderation-hash=d8bebab42eb95b0d26f63a9af979b3d6#comment-6063
    http://cpanetwork.org/2016/10/new-webinar-added/?unapproved=30261&moderation-hash=862161832c68cc8fee940f4416b1f175#comment-30261
    http://grupohbax.com.mx/inicio/bienvenidos-a-grupo-hbax/?unapproved=874&moderation-hash=a873ddb9ad45412b1b81df2f713ed8ab#comment-874
    http://www.curethecare.com/publications/blogs-and-essays/?unapproved=23168&moderation-hash=91fd647e9bcd6aae16a92adf53a23ad3#comment-23168
    https://beautybeyondskin.com/alergia-na-pele-pode-ser-dermatite-atopica/?unapproved=1320&moderation-hash=545f295808834c6e06e62d20e941d01c#comment-1320
    http://bonsaicuritiba.com.br/produto/bonsai-de-pitanga-01-17-anos/?unapproved=4869&moderation-hash=38914d4faa4d6a879617955ea1899594#comment-4869

Leave a Reply

Your email address will not be published. Required fields are marked *