Script to perform actions on remote virtual machines via LAN packets
Written primarily for Proxmox VE ≥ v4.x
All thanks and credits to Oliver Jaksch
Source repository:
https://github.com/bolzerrr/dosthol
Discussion: Proxmox forum
https://forum.proxmox.com/threads/update-wake-and-other-on-lan-for-vms-v0-3.26381/
apt update
apt install gawk socat xxd vim gitcd /root
git clone https://github.com/bolzerrr/dosthol.git
cd dostholinstall -m 0755 dosthold.sh /usr/local/bin/dosthold.sh
install -m 0755 dostholc.sh /usr/local/bin/dostholc.shcp dosthol.service.app /etc/systemd/system/dosthol.service
chown root:root /etc/systemd/system/dosthol.service
chmod 0644 /etc/systemd/system/dosthol.serviceThe unit file must not be executable and must not have setuid/setgid bits.
systemctl daemon-reload
systemctl enable --now dosthol.service
systemctl status dosthol.servicedostholc – The dosthol client, v0.7
-f | --function wakeup | shutdown | poweroff | suspend | resume | reboot | reset
-m | --mac MAC address (11:22:33:44:55:66)
-i | --ip 255.255.255.255 (default broadcast)
-v | --verbose 0 | 1
Example:
dostholc.sh -f wakeup -m AA:BB:CC:DD:EE:FF -i 192.168.0.255 -v 1systemctl stop dosthol.service
systemctl disable dosthol.service
rm -f /etc/systemd/system/dosthol.service
systemctl daemon-reload
rm -f /usr/local/bin/dosthold.sh
rm -f /usr/local/bin/dostholc.sh(Optional) Remove source checkout:
rm -rf /root/dosthol- Proxmox VE ≥ 4.x
- socat
- gawk
- xxd
- vim
- git