.
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
.
<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.
.
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) 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 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.