- bugfix: 30_MilightBridge: Minor change to ping code to try and resolve crash when hostname not in dns

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@8812 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mattwire 2015-06-23 20:36:03 +00:00
parent 85d34bd52b
commit e5fff7f4b1
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- bugfix: 30_MilightBridge: Minor change to ping code to try and resolve
crash when hostname not in dns
- bugfix: pilight_ctrl: reset - clear send queue - bugfix: pilight_ctrl: reset - clear send queue
- feature: pilight_ctrl: add attribute SendTimeout for aborting sending commands - feature: pilight_ctrl: add attribute SendTimeout for aborting sending commands
- feature: FB_CALLMONITOR: add TR-064 support for remote phonebook reading - feature: FB_CALLMONITOR: add TR-064 support for remote phonebook reading

View File

@ -203,14 +203,12 @@ sub MilightBridge_State(@)
# Do a ping check to see if bridge is reachable # Do a ping check to see if bridge is reachable
# check via ping # check via ping
my $pingstatus = "ok"; my $pingstatus = "unreachable";
my $p = Net::Ping->new('udp'); my $p = Net::Ping->new('udp');
if( $p->ping($hash->{HOST}, 2)) { my $alive = $p->ping($hash->{HOST}, 2);
$pingstatus = "ok";
} else {
$pingstatus = "unreachable";
}
$p->close(); $p->close();
$pingstatus = "ok" if $alive;
# And update state # And update state
readingsSingleUpdate($hash, "state", $pingstatus, 1); readingsSingleUpdate($hash, "state", $pingstatus, 1);