Skip to main content

WOL on ubuntu

Install etherwake

sudo apt install etherwake

set up sudo’s file to allow for passwordless sudo for the main user for etherwake

sudo nano /etc/sudoers

 

add this to the bottom of it

av av-time-v2 = (root) NOPASSWD: /usr/sbin/etherwake

This will allow the user av to run the desired commands on av-time-v2 without entering a password. All other sudoed commands will still require a password.

The commands specified in the sudoers file must be fully qualified (i.e. using the absolute path to the command to run) as described in the sudoers man page. Providing a relative path is considered a syntax error.

modify the main crontab of the system

sudo crontab -e

add this to the bottom

0 7 * * * /home/av/wakeonlan.bash

create the following script at /home/av/wakeonlan.bash. Modify the vearable lan1 to the network interface you wish to use.

#!/bin/bash
#06:55 am
lan1=ens160
#bar screens
sudo etherwake -i $lan1 f4:ed:5f:a0:17:ca 
sudo etherwake -i $lan1 f4:ed:5f:a0:17:c9 

sudo etherwake -i $lan1 F4:ED:5F:A0:18:11
sudo etherwake -i $lan1 F4:ED:5F:A0:18:10
sudo etherwake -i $lan1 F4:ED:5F:A0:18:24
echo  after the nancy
#Venue Screens
sudo etherwake -i $lan1 F4:ED:F5:A4:13:22
sudo etherwake -i $lan1 F4:ED:F5:A4:13:23
#Headshot Wall
sudo etherwake -i $lan1 F4:ED:5F:A0:19:22
sudo etherwake -i $lan1 F4:ED:5F:A0:18:F6
sudo etherwake -i $lan1 F4:ED:5F:A0:19:23
sudo etherwake -i $lan1 F4:ED:5F:A0:18:60
echo after headshot

echo yeet

Set the bloody timezone

sudo timedatectl set-timezone Australia/Sydney

Multiple options can be selected.