[SOLVED] Script or Daemon to reboot if internet down?

After a recent cable modem upgrade, my arch box appears to lose connectivity while I am working on it remotely. If I reboot it, it re-establishes the connection and starts working again..
Since this seems to happen while I am working remotely, it becomes very frustrating because I cannot troubleshoot it until I get home. I was curious if anyone knew or had a script or daemon that frequently checks for internet connectivity. If it doesn't have connectivity, then reboots the system or restarts networking.. This would be helpful so I could at least remotely connect and determine what is causing the issue..
Anyone?
EDIT: I guess this is pretty simple to run a cron job to check connectivity via a script and reboot if connectivity is lost..Here's what I got so far.. Anyone have anything else??
#!/bin/bash
WGET="/usr/bin/wget"
$WGET -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
reboot
else
echo "connection working.."
fi
Last edited by brenix (2011-01-05 19:35:10)

eldragon wrote:instead of rebooting, cant you just bring the interface down and up again?
He can't deal with anything on the computer if he is remotely logged in and then the network goes down.
Instead of downloading google with wget why not just ping it three times (ping -c 3 www.google.com). If the ping fails then reboot. Put it in a script and run it from a cron job every 5 mins.

Similar Messages

  • MSI Z87I Won't Reboot or Shut DOwn

    My new system won't shut down or reboot from the OS (Ubuntu 14.04) or from the BIOS settings, i.e. Settings -> Save & Exit -> Save Changes and Reboot will not reboot the system. All my peripherals will turn off, but the fans stay on and the only way to power off the system is to long-hold the power switch on the front of the case or turn off the power at the PSU.
    There is ONE case in which the system will reboot. If I go to Settings -> Save & Exit, choose "Restore Defaults" and then select "Save Changes and Reboot," the system will reboot one time, but it won't reboot or shut down after this.
    I'm already on my second MoBo since I thought it was a MoBo issue.
    Specs:
    SSD: Patriot Pyro 60GB
    Memory: 2x PNY 4GBH2X02E99927-16-H
    CPU: Intel Core i3-4150 LGA1150
    PSU: Thermaltake TR2 500W
    I've tried reseating the MoBo as well as testing it outside of the case with no luck.

    Quote from: rusty.carruth on 10-January-15, 07:52:22
    Ah, thanks!  Got it.
    It looks to me like that is a different link to the same program, as when I downloaded it I got 'MSIHQ Tool 1.25g Installer(1).rar' as the filename, since I had just downloaded 'MSIHQ Tool 1.25g Installer.rar' from the link I posted (or perhaps from a page pointed to by that page, I've already forgotten where I got it...)
    I notice that the '180' file has a batch file that runs 'fpt'.  Am I supposed to run that batch file, or run 'efiflash bios.bin'?  (Or both if this is the first time I've flashed the motherboard)
    Quote
    It looks to me like that is a different link to the same program, as when I downloaded it I got 'MSIHQ Tool 1.25g Installer(1).rar' as the filename, since I had just downloaded 'MSIHQ Tool 1.25g Installer.rar' from the link I posted (or perhaps from a page pointed to by that page, I've already forgotten where I got it...)
    em nope, its the same program. (1) is auto renamed because the same name was already existing in your download folder
    Quote from: rusty.carruth on 10-January-15, 07:52:22
    I notice that the '180' file has a batch file that runs 'fpt'.  Am I supposed to run that batch file, or run 'efiflash bios.bin'?  (Or both if this is the first time I've flashed the motherboard)
    no need to run anything
    just let the tool to prepare the USB key then boot from it
    when this menu appear select option 2:
    1 Run Memtest
    2 Proceed with BIOS Update
    3 Flash back to prevision bios
    then press any key after read some safety instructions
    then when asked if you want to Run Memtestx86, answer with "N"
    then flash will start and will be asked for reboot when its done
    you no need to type or run anything manually, its tottaly automated

  • IPod Touch 2.0.1 Reboots and shuts down randomly

    I have an 8gb iPod touch on the 2.0.1(5b108) firmware that now reboots and shuts down randomly while just sitting idle. I've tried restoring and resetting and it still does this. In terms of the shutting down randomly it seems like my hold button is sticking or broken, but I can't explain the random restarting. This has only been happening since I updated to 2.0.1. Any advice?

    As posted before as m9performance but the forum would not let me logo on as that.
    This has been going on for some time now Apple was to fix this problem with the 2.0 update absolute rubbish it is now worse that before just turning it self off and resetting it self e.g. tonight from 17-30h to 18-45h it did this 3 soddin times.
    Where as before it would be about once every 3 weeks or monthly it is about time Apple started to honour their customers with a product that works e.g. it dose what it says on the box and plays music until the customer tells it not to.
    Come on Apple fix up and fix your product lots of people have mp3 players with out the touch problems like I have said before never mind bringing out a new bigger one 32G get the old ones working first. At the end of the day it is down to YOU Apple and not for the users to have to keep posting the same problems hoping that you as a company decide to fix your mistakes and eventually look after your customers.

  • I Have Iphone 4 IOS ios 7.0.3 half update than internet down my phone no working

    I Have Iphone 4 IOS ios 7.0.3 half update than internet down my phone no working what to do ?

    I have the same issue. The iphone4 is stuck in the Apple logo, makes two vibrations, then goes all screen off, then a beep. And it starts again. I am having this issue for almost a day. Battery dies and I recharge, and does the same thing. I cannot complete the update and I do not have access to my iphone4. I connected to my iMac and iTunes detected my phone updated with 7.0.3, and even completes a sync. However the phone keeps on the apple logo screen and then goes black again.
    I was reading some posting here and I did a ¨Recovery¨combination: Hold the home button and the Wake/sleep button at the same time for 30 seconds and then the iPhone 4 entered in Recovery mode. It is now erasing my phone content and downloading the 7.0.3 in iTunes, it says will take 33 minutes to iPhone Software Upgrade. The screen on my iPhone4 is now showing the iTunes app logo and the connector. Seems I need to recover everything again.
    Hope someone has a short answer and a better solution for you before entering into Recovery mode.
    Good luck!

  • Stream movies from my computer using home share to apple TV (gen 3) is using up my internet down load allowance?

    I have been using Apple TV (gen 3) to stream movies from my computer using Home Share but found my internet down load increased, I have read online forums which all say they don't think the home sharing uses your internet down load but when I played a movie then paused and unplugged my cable from my router I was unable to continue streaming the movies which tells me I am using internet down load. Can I use my Apple TV to stream already downloaded and saved movies from my computer to Apple TV without using the internet?

    Sorry diesel, to amswer your question: I am selecting "Computers" from the ATV which inturn streams the movies from the iTunes on my computer.
    If I unplug my internet cable from the router I am unable to continue streaming the movie? this tells me that it is using my ISP internet to stream, I have checked all my settings but can't see anywhere that would make it stream direct from my router to ATV.
    Just can't work it out???

  • Skype not resoinding after internet down

    I use skype 7.5.80.102 on win 7 .
    When internet down, after that internet up my skype not responring.
    And when i log out my computer, after that i login skype also not responring
    Below is log in window.
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/ev​ent">
    <System>
      <Provider Name="Application Hang" />
      <EventID Qualifiers="0">1002</EventID>
      <Level>2</Level>
      <Task>101</Task>
      <Keywords>0x80000000000000</Keywords>
      <TimeCreated SystemTime="2015-06-05T05:56:57.000000000Z" />
      <EventRecordID>23548</EventRecordID>
      <Channel>Application</Channel>
      <Computer>ThinhNK-PC</Computer>
      <Security />
      </System>
    - <EventData>
      <Data>Skype.exe</Data>
      <Data>7.5.80.102</Data>
      <Data>1b64</Data>
      <Data>01d09f3f79845598</Data>
      <Data>57</Data>
      <Data>C:\Program Files (x86)\Skype\Phone\Skype.exe</Data>
      <Data>ab37a450-0b47-11e5-8793-2c768ae17f9b</Data>
      <Binary>430072006F00730073002D0074006800720065006100640000​000000</Binary>
      </EventData>
      </Event>

    Attached is the zipped file as requested. 
    Skype has now been updted to version 7.0.0.100 this moring but the same issue , Going to hang & message " skype not responding" & screen get frozen. I have to go to Task manager to end the task. 
    Attachments:
    DxDiag.zip ‏7 KB

  • Cannot Access SQL Server When Internet Down

    Dear All,
    I have a problem about connect to sql server.
    I can't connect to sql server when my internet down.
    The server in one network with my PC. I connect to the server with local IP.
    Server IP 172.1.2.1 and my ip 172.1.2.25. I connect with windows Authentication.
    When internet down, i can't connect to sql server using windows authentication but still work with sql server authentication.
    What must i do to fix this problem?
    i want connect sql server using windows authentication with or without internet connection.
    Best regards,
    Surbakti

    Hello,
    If you have the Named Pipes protocol enable, you can use (local) or the dot “.” as instance name,
    instead of the IP or the name of the computer.
    http://technet.microsoft.com/en-us/library/ms191294.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Mail locked up and now it will not close or allow me to reboot or shut down. Any ideas? Thanks

    My mail has locked up and I can't reboot or shut down the computer. Also in mail the left click does not work; it is just stuck. Any ideas? Thanks

    BTW - there is also the Force Quit option in the Apple menu dropdown. Wasn't sure if you could select menu bar options, so gave you the keystroke shortcut.
    Cheers,
    GB

  • [solved]script fails when changing profile through powerdevil.

    i use ondemand governor and i want to change up_threshold value.
    Whenever i change profile through powerdevil up_threshold gets its default vaule of 80.
    what i did was to create a script named threshold containing the lines:
    #!/bin/bash
    sudo sh -c 'echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold'
    i have also set through /etc/sudoers that this script is passwordless for my user.
    if i run the script, it successfully changes the value. It also runs successfully if i put it in startup.
    My problem is that it fails to run when i choose it to run when a profile loads through powerdevil. I am refering to the feature shown below :
    at first i thought that this function has a problem. so i chose to run kate, and when i changed profile, kate started immediately. So i guess that there is a problem with my script.
    Any ideas?
    Last edited by mechmg93 (2009-10-20 20:14:30)

    I hope someone reads this thread also its already marked as solved...
    Anyway, i would like to use CPU frequency scaling, but in the powermanagement settings,
    i cant shoose anything for frequency scaling.
    What do i have to do to be able to set "ondemand" or "always lowest frequency"?
    Wich daemons and/or modules do i have to activate to change the frequency policy?
    Would be very nice if someone could help me.

  • Whilst connected to internet itunes will only open once after rebooting and thereafter it will not open again until reboot. When reboot with internet off itunes will open repeatedly. Help

      This problem has only appeared in the past few days before that I had nio problems with itunes. Firstly I discovered that I could only open Itunes once after reboot - thereafter it would not reopen until I reboot again.  I have spent considerable hours yesterday talking to the Apple help by phone and tried all there suggestions including of course reinstalling itunes amongst other things.  Eventually I thought the problem had been solved when I discovered that I could suddenly open Itunes repeatedly without rebooting.  After a short time I then discovered that the reason it was working agai was that I had rebooted with the internet disconnected and itunes would open repeatedly as normal provide I left the internet disconnected.  When I reconnect to internet the problem resurfaces. HELP

    For those still wondering how to install ios 6.1 on 5th gen iPod, you need to download it off of apples official website and then shift click restore from backup and choose the downloaded ios 6.1
    apples one year warrant covers any hardware problems like these right?

  • [SOLVED] Network restart before Arch can access internet via IPCop?

    The Leopard machines on our LAN have working internet on boot, my Arch box does not?
    Even though I have the IPCop server's IP in the Arch /etc/resolv.conf.head file, I still have to do a sudo /etc/rc.d/network restart before I can use the internet.
    Does anyone know how I can solve this one?
    Thanks for your time.
    Last edited by handy (2008-12-13 13:41:04)

    tomk wrote:Post your /etc/rc.conf. If '/etc/rc.d/network start' works but network-at-boot-time doesn't, that's where the error is.
    As a workaround I've put /etc/rc.d/network start in my /etc/rc.local & now I don't have to type it manually.
    tomk wrote:Incidentally, dhcpcd messages don't show up in dmesg - you should be looking in messages.log or everything.log.
    I looked in all the logs that had been changed after a boot.
    Here is my rc.conf:
    # /etc/rc.conf - Main Configuration for Arch Linux
    # LOCALIZATION
    # LOCALE: available languages can be listed with the 'locale -a' command
    # HARDWARECLOCK: set to "UTC" or "localtime"
    # TIMEZONE: timezones are found in /usr/share/zoneinfo
    # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
    # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
    # CONSOLEMAP: found in /usr/share/kbd/consoletrans
    # USECOLOR: use ANSI color sequences in startup messages
    LOCALE="en_AU.utf8"
    HARDWARECLOCK="UTC"
    TIMEZONE="Australia/Sydney"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    # HARDWARE
    # Scan hardware and load required modules at bootup
    MOD_AUTOLOAD="yes"
    # Module Blacklist - modules in this list will never be loaded by udev
    MOD_BLACKLIST=(net-pf-10 pcspkr) ## turns off ipv6 & pc speaker
    # Modules to load at boot-up (in this order)
    # - prefix a module with a ! to blacklist it
    MODULES=(sky2 snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore fglrx)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    # NETWORKING
    HOSTNAME="archtypical"
    # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available
    # interfaces.
    # Interfaces to start at boot-up (in this order)
    # Declare each interface then list in INTERFACES
    # - prefix an entry in INTERFACES with a ! to disable it
    # - no hyphens in your interface names - Bash doesn't like it
    # Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
    ###lo="lo 127.0.0.1"
    # eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
    eth0="dhcp"
    ###INTERFACES=(lo eth0)
    INTERFACES=(eth0)
    # Routes to start at boot-up (in this order)
    # Declare each route then list in ROUTES
    # - prefix an entry in ROUTES with a ! to disable it
    # gateway="default gw 192.168.0.1"
    ROUTES=(!gateway)
    # Enable these network profiles at boot-up. These are only useful
    # if you happen to need multiple network configurations (ie, laptop users)
    # - set to 'menu' to present a menu during boot-up (dialog package required)
    # - prefix an entry with a ! to disable it
    # Network profiles are found in /etc/network-profiles
    #NET_PROFILES=(main)
    # DAEMONS
    # Daemons to start at boot-up (in this order)
    # - prefix a daemon with a ! to disable it
    # - prefix a daemon with a @ to start it up in the background
    DAEMONS=(syslog-ng @iptables @network @netfs @crond @alsa @portmap @sshd @transmission-daemon @stb-admin @fam @gpm)# @tor @privoxy # @hal - hal's out on account of worker
    # End of file
    Last edited by handy (2008-12-13 12:30:42)

  • Scripting error when using 64 bit internet explorer

    Could you please give me a solution to the following:
    Laptop  HP Pavillion dv7-3112sa  Windows 7
    Printer  HP Photosmart B209
    Wireless connection Netgear DGND 3300 v2
    When I use internet explorer 64 bit and try to print, I get a message "Scripting Error" and it will not print.
    This is OK on 32 bit.
    I cannot update my HP software because I lose wireless communications altogether and have to do a restore to get it to work again.
    This question was solved.
    View Solution.

    Scripting errors are related to how the website behaves with a browser.
    In this case, it is printing script that is having an issue and it appears to be with the 64bit Internet Explorer since it works fine with Internet Explorer 32bit.
    Review this article from Microsoft regarding this issue.
    You have already found the best resolution to this issue:  Using 32bit Internet Explorer.
    64bit web browsing is still a very small portion of web sites and very few fully support the 64bit browsing experience.  I highly recommend using a 32bit web browser for viewing websites as this will give you the best compatibility as every website still supports 32bit browsing, but not all sites are fully compatible with 64bit browsers.  
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Why do I have to reboot my internet SO much?!

    All right. I have no idea where to post this, so i figure since I've suspected this could link to a hardware issue to my PC, I feel it's proper to maybe bring it here because of that.
    I keep my PC on 24/7, which may be unhealthy for the machine, may not be. I'm finding it frustrating every growing minute it happens when I can't load certain pages via internet. It forces me to have to reboot my whole PC sometimes for it to get connectivity. Sometimes, i've had to reboot my own DSL Modem so I could get internet connectivity.
    I always know when I have to, when I get "Server Not Found" errors on sites like Google or that Thunderbird won't connect to the IMAP servers for my mail or that Steam cannot load it's store page, bringing back 503 Errors. That's when I have to reboot my DSL Modem, as well when I can't get to certain other pages.
    I'll also know when the little internet icon shows the little caution triangle on it, that's when I have to reboot the whole machine to get internet back.
    So, I'm thinking something is about to fail or is on the verge of failing. I highly suspect the onboard ethernet port, because I really doubt this could be a faulty cable. Otherwise, it wouldn't let me on.
    Any ideas.

    The problem could be your DSL service.   The farther away you get from the central office, the weaker the signal becomes. Because of this, I have linked the table.   I had DSL, and hopefully will never go back.   About that "constant on", I have 2 systems doing 24/7.  One had to be replaced after 7 years.  During those 7 years, I had a power surge (thru supressor) that took out the 350W PSU, and a TV tuner card.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • SSH startup script when the system reboot

    Hi all,
    I have a script for start/stop for sshd and it is fully tested and worked well. I have create the link to rc2.d. When the system reboot, 'PRNG not seed' is shown and the sshd cannot start up after reboot. Then, I can start sshd manually. Is it possible to start the sshd automatically after reboot?
    Please advise.
    Thank you for your attention.

    If you're running prngd daemon for entropy generation on your system, make sure prngd starts before sshd. It seems like you're able to successfully start the sshd daemon manually because prngd has already been started on systems bootup.

  • E90 Reboots during internet call

    hi,
    i am facing a new problem wid my e90. it reboots itself when i make an internet call(mostly DURING the call and sometimes AFTER the call). i have been using internet call for a about a month now without any probs. just started facing it today. can anyone help please.
    the changes i did in the last 24 hrs were:
    1. edited my sip profile (only changed username)
    i had no problems when i used the same profile wid the previous username all dis month. so kindly advise what could have triggered this poblem.
    Solved!
    Go to Solution.

    found the problem,
    i noticed the rebooting sequence getting worse as it happened every 2 - 3 mins. so this is what i did,
    1. removed my memory card and run the phone. it seemed to work normally. no hang and no reboots.
    2. removed the battery for a while, then started the phone again ( without memory card )
    3. now inserted the memory card... and the phone seems to have worked fine ever since.
    anyone has a logic to wats the reason behind this sequence?

Maybe you are looking for

  • My Mac Pro display setup for photography

    I am a photographer and a recent refugee from Windows. I'm using my new Mac Pro to manage and process about 100K images and other digital assets. I'm especially pleased with my system's display configuration. Here is what I've got: I'm driving my dis

  • Is there a way to put the bluetooth icon on the homepage?

    I pair my iphone with my car when I'm driving. Is there a way to put the bluetooth icon on the homepage so I don't have to go through settings to turn the bluetooth on and off? I don't like to leave the bluetooth on all the time because it drains the

  • In ALV output, select row(s), How can we know which record it has selected?

    Hi Experts, In ALV output, there are 10 records (rows) displayed. I want to select specific row (or rows) for mass printing ( I need to assign respective smartform for selected row(s)). How the system (or my self) will recognize that which record it

  • Tcode OAOR in View mode

    Hi everyone, I want to use the OAOR tcode, in only read mode, but, even I put act. 03 in al objects that's needed, however I can create, delete or modify documents on my society. I'm on SP BASIS 13, and my user only have the autorization to do OAOR,

  • Preview clips blacked out in imovie/desktop prefs after 10.4 upgrade

    I recently upgraded to tiger 10.4 and when i open sys prefs/desktop/iphoto folder all of my images come up black squares. The same thing happens when I open imovie and want to access photo clips. The file names appear but images are blacked out. Any