diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml new file mode 100644 index 0000000..d31c17f --- /dev/null +++ b/.builds/freebsd.yml @@ -0,0 +1,16 @@ +image: freebsd/latest +packages: + - go +sources: + - https://github.com/mdlayher/wol +environment: + GO111MODULE: "on" +tasks: + - build: | + go version + go get golang.org/x/lint/golint + go get honnef.co/go/tools/cmd/staticcheck + cd wol/ + /home/build/go/bin/staticcheck ./... + /home/build/go/bin/golint -set_exit_status ./... + go test -v -race ./... diff --git a/.builds/linux.yml b/.builds/linux.yml new file mode 100644 index 0000000..0420ebf --- /dev/null +++ b/.builds/linux.yml @@ -0,0 +1,16 @@ +image: archlinux +packages: + - go +sources: + - https://github.com/mdlayher/wol +environment: + GO111MODULE: "on" +tasks: + - build: | + go version + go get golang.org/x/lint/golint + go get honnef.co/go/tools/cmd/staticcheck + cd wol/ + /home/build/go/bin/staticcheck ./... + /home/build/go/bin/golint -set_exit_status ./... + go test -v -race ./... diff --git a/README.md b/README.md index c8c12bf..253ff3d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -wol [![Build Status](https://travis-ci.org/mdlayher/wol.svg?branch=master)](https://travis-ci.org/mdlayher/wol) [![Coverage Status](https://coveralls.io/repos/mdlayher/wol/badge.svg?branch=master)](https://coveralls.io/r/mdlayher/wol?branch=master) [![GoDoc](http://godoc.org/github.com/mdlayher/wol?status.svg)](http://godoc.org/github.com/mdlayher/wol) -=== +# wol [![builds.sr.ht status](https://builds.sr.ht/~mdlayher/wol.svg)](https://builds.sr.ht/~mdlayher/wol?) [![GoDoc](https://godoc.org/github.com/mdlayher/wol?status.svg)](https://godoc.org/github.com/mdlayher/wol) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/wol)](https://goreportcard.com/report/github.com/mdlayher/wol) -Package `wol` implements a Wake-on-LAN client. MIT Licensed. +Package `wol` implements a Wake-on-LAN client. MIT Licensed. This package exposes two types, which operate slightly differently: + - `Client`: WoL client which uses UDP sockets to send magic packets - `RawClient` WoL client which uses raw Ethernet sockets to send magic packets -For most use cases, the `Client` type will be sufficient. The `RawClient` type requires -elevated privileges (root user) and currently works with Linux only. +For most use cases, the `Client` type will be sufficient. The `RawClient` type +requires elevated privileges (root user) and works on Linux or *BSD/macOS only. diff --git a/cmd/wol/README.md b/cmd/wol/README.md index 1cccbcd..012ec60 100644 --- a/cmd/wol/README.md +++ b/cmd/wol/README.md @@ -1,29 +1,32 @@ -wol -=== +# wol Command `wol` is a simple Wake-on-LAN client. It can issue Wake-on-LAN magic -packets using both UDP or raw ethernet sockets. +packets using both UDP or Ethernet sockets. -Usage ------ +## Usage -``` +```text +$ ./wol -h Usage of ./wol: - -a="": network address for Wake-on-LAN magic packet - -i="": network interface to use to send Wake-on-LAN magic packet - -p="": optional password for Wake-on-LAN magic packet - -t="": target for Wake-on-LAN magic packet + -a string + network address for Wake-on-LAN magic packet + -i string + network interface to use to send Wake-on-LAN magic packet + -p string + optional password for Wake-on-LAN magic packet + -t string + target for Wake-on-LAN magic packet ``` Issue Wake-on-LAN magic packet using UDP network address: -``` -$ ./wol -a 192.168.1.1:7 -t 00:12:7f:eb:6b:40 +```text +./wol -a 192.168.1.1:7 -t 00:12:7f:eb:6b:40 ``` -Issue Wake-on-LAN magic packet using raw ethernet sockets (requires elevated +Issue Wake-on-LAN magic packet using Ethernet sockets (requires elevated privileges): -``` -$ sudo ./wol -i eth0 -t 00:12:7f:eb:6b:40 +```text +sudo ./wol -i eth0 -t 00:12:7f:eb:6b:40 ```