Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
welcome:ubuntu:wake-on-lan [2021/03/23 19:06] 127.0.0.1 modification externe |
welcome:ubuntu:wake-on-lan [2023/01/02 17:34] (Version actuelle) arnaud |
||
---|---|---|---|
Ligne 27: | Ligne 27: | ||
On a server without GUI = with " | On a server without GUI = with " | ||
https:// | https:// | ||
+ | |||
+ | <color # | ||
+ | Useful to wakeup a server when the client starts. | ||
+ | < | ||
+ | [Unit] | ||
+ | After=network-online.target | ||
+ | Wants=network-online.target | ||
+ | |||
+ | [Service] | ||
+ | ExecStart=/ | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=default.target </ | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | sudo chmod 664 / | ||
+ | < | ||
+ | sudo systemctl enable wol-omv.service | ||
+ | sudo systemctl daemon-reload </ | ||
+ | |||
+ | Script pour contrôler que la machine qui a recu le paquet magique s'est bien lancée - peut être ajouté au script de WOL: | ||
+ | < | ||
+ | ip=(69) | ||
+ | |||
+ | for i in `seq 1 10`; do | ||
+ | |||
+ | echo "test ping sur IP 192.168.20." | ||
+ | if $(ping -c 1 192.168.20.$ip &> /dev/null) ; then | ||
+ | echo " | ||
+ | beep -f 1000 -n -f 2000 -n -f 1500 | ||
+ | exit | ||
+ | |||
+ | else | ||
+ | echo " | ||
+ | sleep 10s; | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | echo " | ||
+ | beep -f 300.7 -r 2 -d 100 -l 400 </ | ||
+ | |||
+ |