| 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 | |