Skip to content

Add wake on LAN option to wake up the host systen - #165

Open
chriss158 wants to merge 1 commit into
thomasmauerer:masterfrom
chriss158:master
Open

Add wake on LAN option to wake up the host systen#165
chriss158 wants to merge 1 commit into
thomasmauerer:masterfrom
chriss158:master

Conversation

@chriss158

@chriss158 chriss158 commented Jan 23, 2024

Copy link
Copy Markdown

Hi Thomas,

Thanks for the great addon.

My backup system does not run 24/7, so I was missing the option to wake up my system before copying the backup.
This PR adds the option to do a WOL before copying the backup to the host system.

A few notes on implementation:

  • If WOL is enabled and host_mac is missing, the addon will fail on startup because the addon is misconfigured.
  • When the addon pings a DNS name, the ping output may be "ping: bad address". This seems to be a DNS issue. So I added a log message to indicate that the user should use the IP address instead.

The process of doing a WOL is as follows:

  1. Check if WOL is enabled

  2. Check if host is online

    • If the host is online

      1. Continue copying the backup
    • If host is offline

      1. Send WOL

      2. Ping host system 100 times

      3. Check if host comes up within 100 pings

        • Host comes up within 100 pings

          1. Wait another 60 seconds for the host to settle.
          2. Continue copying the backup
        • Host did NOT come up after 100 pings

          1. Cancel the backup copy with a warning

Thanks for reviewing my PR and just let me know if there is anything to change.

@thomasmauerer

Copy link
Copy Markdown
Owner

Thanks for your two PRs. I'll take a look at them on the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants