Ticket #3913: pingtest-WOL.patch

File pingtest-WOL.patch, 1.1 KB (added by Nigel, 12 years ago)

Patch against recent SVN trunk

  • libs/libmyth/mythcontext.cpp

     
    10911092    if (host == "localhost" || host == "127.0.0.1" || host == m_localhostname)
    10921093        doPing = false;
    10931094
     1095
     1096    // If WOL is setup, the backend might be sleeping:
     1097    if (doPing && m_DBparams.wolEnabled)
     1098        for (int attempt = 0; attempt < m_DBparams.wolRetry; ++attempt)
     1099        {
     1100            int wakeupTime = m_DBparams.wolReconnect;
     1101
     1102            if (ping(host, wakeupTime))
     1103            {
     1104                doPing = false;
     1105                break;
     1106            }
     1107
     1108            VERBOSE(VB_GENERAL, "Trying to wake up host " + host
     1109                                + ", attempt " + QString::number(attempt));
     1110            system(m_DBparams.wolCommand);
     1111
     1112            VERBOSE(VB_GENERAL, "Waiting for "
     1113                                + QString::number(wakeupTime) + " seconds");
     1114            sleep(m_DBparams.wolReconnect);
     1115        }
     1116
     1117
    10941118    if (doPing)
    10951119    {
    10961120        VERBOSE(VB_GENERAL,