Failed to enable unit: Unit WoL.service does not exist

So, the command sudo ethtool enp13s0 | grep Wake-on returned the value d, which means WoL is disabled. I decided to create a service that would run the command ethtool -s enp13s0 wol g. The content of the file /etc/default/WoL.sh:
#!/bin/bash
ethtool -s enp13s0 wol g

Execution permission was granted.
The content of the file /etc/systemd/system/WoL.service with permissions 775:
[Unit]
Description=Enabling WoL

[Service]
#path to our program
ExecStart=/etc/default/WoL.sh
Type=oneshot
[Install]
WantedBy=default.target

When trying to activate the service with the command sudo systemctl enable WoL.service, I get the error Failed to enable unit: Unit file service does not exist. What am I doing wrong?
Solution
Ok, fine, I copied the contents of the service, deleted the file and created it via terminal using sudo nano. Now the system sees it and turns it on. Judging by the properties of the file, the permissions are exactly the same as they were. Why it worked now, I have no idea
Was this page helpful?