diff options
Diffstat (limited to '')
-rw-r--r-- | bin/Makefile | 1 | ||||
-rw-r--r-- | bin/README | 3 | ||||
-rw-r--r-- | bin/bin.7 | 5 | ||||
-rw-r--r-- | bin/man1/wake.1 | 16 | ||||
-rw-r--r-- | bin/wake.c | 54 |
5 files changed, 2 insertions, 77 deletions
diff --git a/bin/Makefile b/bin/Makefile index c594abe1..7bffb1f9 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -35,7 +35,6 @@ BINS_ANY += setopt BINS_ANY += shotty BINS_ANY += ttpre BINS_ANY += up -BINS_ANY += wake BINS_ANY += when BINS_ANY += xx diff --git a/bin/README b/bin/README index 13ab2a1a..104fc9b5 100644 --- a/bin/README +++ b/bin/README @@ -31,7 +31,6 @@ DESCRIPTION shotty(1) terminal capture ttpre(1) man output to HTML up(1) upload file - wake(1) wake-on-LAN wat(1) watch files when(1) date calculator xx(1) hexdump @@ -40,4 +39,4 @@ DESCRIPTION png(3) basic PNG output -Causal Agency July 24, 2019 Causal Agency +Causal Agency August 28, 2019 Causal Agency diff --git a/bin/bin.7 b/bin/bin.7 index 8dba32b7..95db49b3 100644 --- a/bin/bin.7 +++ b/bin/bin.7 @@ -1,4 +1,4 @@ -.Dd July 24, 2019 +.Dd August 28, 2019 .Dt BIN 7 .Os "Causal Agency" . @@ -88,9 +88,6 @@ man output to HTML .It Xr up 1 upload file . -.It Xr wake 1 -wake-on-LAN -. .It Xr wat 1 watch files . diff --git a/bin/man1/wake.1 b/bin/man1/wake.1 deleted file mode 100644 index 8457b254..00000000 --- a/bin/man1/wake.1 +++ /dev/null @@ -1,16 +0,0 @@ -.Dd September 7, 2018 -.Dt WAKE 1 -.Os -. -.Sh NAME -.Nm wake -.Nd wake-on-LAN -. -.Sh SYNOPSIS -.Nm -. -.Sh DESCRIPTION -.Nm -broadcasts a wake-on-LAN packet -for -.Ql 04:7D:7B:D5:6A:53 . diff --git a/bin/wake.c b/bin/wake.c deleted file mode 100644 index 82fa2e6b..00000000 --- a/bin/wake.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2017 June McEnroe <june@causal.agency> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <sys/types.h> - -#include <err.h> -#include <netinet/in.h> -#include <stdlib.h> -#include <sys/socket.h> -#include <sysexits.h> - -typedef unsigned char byte; - -#define MAC 0x04, 0x7D, 0x7B, 0xD5, 0x6A, 0x53 -static const byte Payload[102] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC, - MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC, -}; - -int main() { - int sock = socket(PF_INET, SOCK_DGRAM, 0); - if (sock < 0) err(EX_OSERR, "socket"); - - int on = 1; - int error = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); - if (error) err(EX_OSERR, "setsockopt"); - - struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_port = 9, - .sin_addr.s_addr = INADDR_BROADCAST, - }; - ssize_t size = sendto( - sock, Payload, sizeof(Payload), 0, - (struct sockaddr *)&addr, sizeof(addr) - ); - if (size < 0) err(EX_IOERR, "sendto"); - - return EX_OK; -} |