.
ctys-wakeup - WoL and IPMI
ctys-wakeup
[-d <level>] [-h] [-H <help-options>] [-i <interface>] [-n] [-p <port>] [-t <TCP/IP address>] [-V] [-X] <mac-address>
ctys-wakeup
(Address-Resolution)
sends a so called MagicPacket(TM) to a given destination.
In case a remote segment is addressed by setting the "-t" option, a
UDP message is sent to port "9".
The script consists of a few lines of bash code with a call to
Netcat. So it could be adapted easily.
mac=$1;shift ip=$1;shift function buildWOLMagicPacket () { local _mac=$1;shift declare -a _pdu; function macAsc2Hex () { for i in ${@};do printf "\x$i" done } #frame _pdu=(ff ff ff ff ff ff); #MAC addr in "little endian" addr=(${mac: }) addrLitteEndian=(${addr[0]} ${addr[1]} \ ${addr[2]} ${addr[3]} \ ${addr[4]} ${addr[5]}); #add 16 duplications for((i=0;i<16;i++));do for m in ${addrLitteEndian[@]};do size=${#_pdu[@]} _pdu[${size}]=$m done done macAsc2Hex ${_pdu[@]} } if [ -n "$ip" ];then printf "`buildWOLMagicPacket $mac`\n"|nc -u -w 1 $ip 9 else buildWOLMagicPacket $mac fi
.
Sets debug.
Print help, refer to "-H" for additional information.
The extended help option is based on system interfaces for display of manpages, PDF and HTML documents. This comprises the man pages and installed manuals.
For additional help refer to the documents or type ctys -H help.
The ethernet-broadcast interface for local segment.
When used "-t" option is not applicable.
No execution, evaluation only.
The port for destination, which is by default "9" for a hard-coded UDP message.
It is not really relevant, might be used only for adaptation to firewall rule.
When provided the packet is send to destination. The destination address could be a "directed-broadcast" address, which has to be supported by the router.
E.g. OpenBSD requires "net.init.ip.directed-broadcast=1", and the appropriate pf-rules.
For 1.2.3.4:
<wol> {1.2.3.255} pass in on \$ifX from <wolExec> to <wol> pass out on \$ifY from <wolExec> to <wol>
Alternatively a "rdr" - Redirection could be set. When this option is not provided, a UDP packet will be sent to "255:255:255:255:9".
When used "-i" option is not applicable.
Version.
See ctys, terse for machine output.
.
The MAC address of the targeted NIC, this could be evaluated by
call of "ctys-macmap" and/or "ctys-vhost"
.
Written and maintained by Arno-Can Uestuensoez:
Maintenance: | <<acue_sf1 (a) users sourceforge net>> |
Homepage: | <https://arnocan.wordpress.com> |
Sourceforge.net: | <http://sourceforge.net/projects/ctys> |
Project moved from Berlios.de to OSDN.net: | <https://osdn.net/projects/ctys> |
Commercial: | <https://arnocan.wordpress.com> |
Copyright (C) 2008, 2009, 2010, 2011 Ingenieurbuero Arno-Can Uestuensoez
For BASE package following licenses apply,
This document is part of the DOC package,
For additional information refer to enclosed Releasenotes and License files.