Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#!/bin/bash #fixes Raspbmc network dropping on the Raspberry Pi #also added the following to '/etc/network/interfaces' # auto eth0 # iface eth0 inet dhcp while true ; do LOGFILE=/home/pi/network-monitor.log if ifconfig eth0 | grep -q "inet addr:" ; then echo "$(date "+%m %d %Y %T") : Ethernet OK" >> $LOGFILE sleep 60 else echo "$(date "+%m %d %Y %T") : Ethernet connection down! Attempting reconnection." >> $LOGFILE ifup --force eth0 OUT=$? #save exit status of last command to decide what to do next if [ $OUT -eq 0 ] ; then STATE=$(ifconfig eth0 | grep "inet addr:") echo "$(date "+%m %d %Y %T") : Network connection reset. Current state is" $STATE >> $LOGFILE else echo "$(date "+%m %d %Y %T") : Failed to reset ethernet connection" >> $LOGFILE fi sleep 10 fi done
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)