sabhiram / go-wol Goto Github PK
View Code? Open in Web Editor NEWSimple wake on LAN magic packet generator for golang
License: MIT License
Simple wake on LAN magic packet generator for golang
License: MIT License
Do you consider changing your CI for Github Actions? It's free and much faster than Travis CI.
I can manage the refactoring by doing a PR if you are interested.
$go get github.com/sabhiram/go-wol
should be replaced by
$go install github.com/sabhiram/go-wol/cmd/wol
See #16
First of all, wol
is a great and reliable tool. Thanks for the work!
My $HOME/.config
path is version controlled, as a backup/restore mechanism for all my linux machines.
Whenever I use wol
it changes bold.db
and thus causing the git status to change. I don't know what's changed, and it's chaning so often.
Can you allow custom location for bolt.db
, make it text based or make it less frequently updated?
Thanks!
It compiles ok on ARMv7 32bits (Beaglebone Black), tests runs ok, but for some reason, the magic packet doesn't wake my server.
Doing the same process in a 64bits computer it works fine but on ARM nothing happens...
$wol MYSERVER
Attempting to send a magic packet to MAC XX:XX:XX:XX:XX:XX
... Broadcasting to: 255.255.255.255:9
Magic packet sent successfully to XX:XX:XX:XX:XX:XX
$go test -v github.com/sabhiram/go-wol/...
=== RUN TestNewMagicPacket
--- PASS: TestNewMagicPacket (0.00s)
=== RUN TestNewMagicPacketNegative
--- PASS: TestNewMagicPacketNegative (0.00s)
=== RUN TestMagicPacketMarshal
--- PASS: TestMagicPacketMarshal (0.00s)
PASS
ok github.com/sabhiram/go-wol 0.041s
=== RUN TestDecodeToMacIface
--- PASS: TestDecodeToMacIface (0.00s)
=== RUN TestEncodeFromMacIface
--- PASS: TestEncodeFromMacIface (0.00s)
=== RUN TestRunAllSuites
=== RUN TestAddAlias
--- PASS: TestAddAlias (0.11s)
=== RUN TestAddDuplicateAlias
--- PASS: TestAddDuplicateAlias (0.07s)
=== RUN TestDeleteAlias
--- PASS: TestDeleteAlias (0.10s)
=== RUN TestGetAlias
--- PASS: TestGetAlias (0.09s)
--- PASS: TestRunAllSuites (0.39s)
=== RUN TestIPFromInterface
--- PASS: TestIPFromInterface (0.00s)
=== RUN TestIPFromInterfaceNegative
--- PASS: TestIPFromInterfaceNegative (0.00s)
PASS
ok github.com/sabhiram/go-wol/cmd/wol 0.446s
Having used this WOL tool successfully for quite a long time now out of the blue it has stopped working and I can't figure out why.
I run the command from a shortcut on my desktop that links too.
C:\Users\me\Documents\wol_windows_amd64.exe wake 1c:6f:65:xx:xx:xx
Which provides the response
Attempting to send a magic packet to MAC 1c:6f:65:xx:xx:xx
... Broadcasting to: 255.255.255.255:9
Magic packet sent successfully to 1c:6f:65:xx:xx:xx
But the device doesn't wake.
I am certain everything is set up correctly as triggering the WOL packet from pfsense works as expected.
Have you got any pointers / things to check?
I think wol should create a init db if user aliases is not found
./wol -h
Failed to open WOL DB: open /Users/zhuo/.config/go-wol/bolt.db: no such file or directory
panic: Unable to load user aliases! Exiting...
goroutine 1 [running]:
panic(0x1d88e0, 0xc82000ef10)
/usr/local/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6
main.main()
/Users/zhuo/src/github.com/sabhiram/go-wol/cmd/wol/
Original BoltDB doesn't have support of mips arch, CoreOS maintained fork does and I'd like to use this on some gear with that architecture.
I have a web server (raspberry pi) which has an endpoint (ex: /start ). When I hit this endpoint, I want it to send a magic packet or wake command to a computer in its private network.
Issue is, I can not understand how to call this program from the web server. Only way I can think of right now is to install the go-wol in raspberry pi and then use exec.Command to call the go-wol.
Is it possible to use go-wol from the web server without the above process? or modifying the wol code?
note: When I do go build I want it work right out of the box without any dependencies.
Just started using this tool, so far looks nice!!! Thanks.
Would you be interested in making some changes so the help output is only colorized when sdout is a TTY?
I was on a small little laptop and the help/usage info wrapped off the top of the screen. Sadly "wol | less" was hard to read because of the escape codes, such as:
To fix example:
Not sure how portable your code is, if you are looking for more portable code you could use something like:
https://github.com/mattn/go-isatty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.