From aade5be94f8fe8cfb9b4348f97ad83ac64908c5f Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Wed, 20 Nov 2024 00:09:12 -0800 Subject: Add wake function --- home/root/common/core/zsh/zshrc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'home') diff --git a/home/root/common/core/zsh/zshrc b/home/root/common/core/zsh/zshrc index 28284f8..1d84aaf 100644 --- a/home/root/common/core/zsh/zshrc +++ b/home/root/common/core/zsh/zshrc @@ -72,6 +72,38 @@ function ntrace { } +function wake { + + if [[ -z ${argv} ]]; then + echo 'you must specify a host to wake!!' >&2 + return 1 + fi + + local host="${1}" + + case "${host}" in + jupiter) + host="8c:8c:aa:4e:e9:8c" + ;; + neptune) + host="38:f3:ab:59:08:10" + ;; + saturn) + host="38:f3:ab:59:06:e0" + ;; + uranus) + host="8c:8c:aa:4e:fc:aa" + ;; + *) + echo 'unknown host specified!' >&2 + return 1 + ;; + esac + + wol -vi 192.168.1.255 "${host}" + +} + # prompt/theme shit function precmd { -- cgit v1.2.3