• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

wakeonlan: 可以通过pc发送唤醒包

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

wakeonlan

开源软件地址:

https://gitee.com/libolink/wakeonlan

开源软件介绍:

wakeonlan

一个python制作的魔术唤醒包工具

安装wakeonlan模块

执行下面2行命令,生成安装包,然后切换到dist目录,使用第3行命令安装包。安装以后就可以用cmd输入wakeonlan命令测试使用。

1.python setup.py bdist_egg

2.python setup.py sdist

3.pip install wakeonlan-0.1*.tar.gz

注意:要想唤醒成功,必须把目标主机BIOS和电源相关设置弄好,具体可以百度。

作为模块使用

  • Import the module
>>> from wakeonlan.wakeonlan import *
  • Wake up a single computer by its mac address
>>> send_magic_packet('ff.ff.ff.ff.ff.ff')
  • Wake up multiple computers by their mac addresses.
>>> send_magic_packet('ff.ff.ff.ff.ff.ff', '00-00-00-00-00-00',...                   'FFFFFFFFFFFF')
  • An external host may be specified. Do note that port forwarding on that hostis required. The default ip address is 255.255.255.255 and the default portis 9.
>>> send_magic_packet('ff.ff.ff.ff.ff.ff',...                   ip_address='example.com',...                   port=1337)

作为命令行使用

usage: wakeonlan [-h] [-i ip] [-p port] mac address [mac address ...]Wake one or more computers using the wake on lan protocol.positional arguments:  mac address  The mac addresses or of the computers you are trying to wake.optional arguments:  -h, --help   show this help message and exit  -i ip        The ip address of the host to send the magic packet to.               (default 255.255.255.255)  -p port      The port of the host to send the magic packet to (default 9)

Dependencies

Python3.x

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap