mirror of
https://github.com/ShadowKatStudios/OC-Minitel.git
synced 2024-11-26 03:48:06 +11:00
Compare commits
No commits in common. "1b53606fe48a385748aa1872b1c4ac72190b98d1" and "37db09d47200f9cca5e050ea1e11a634e69f739c" have entirely different histories.
1b53606fe4
...
37db09d472
@ -1 +0,0 @@
|
||||
usr/man/wolbeacon
|
@ -1,64 +0,0 @@
|
||||
local serial = require "serialization"
|
||||
local component = require "component"
|
||||
local event = require "event"
|
||||
|
||||
local timer = -1
|
||||
|
||||
local cfg = {}
|
||||
cfg.broadcast = true
|
||||
cfg.receive = true
|
||||
cfg.delay = 60
|
||||
cfg.port = 3442
|
||||
cfg.message = "WoLBeacon"
|
||||
|
||||
local function saveConfig()
|
||||
local f = io.open("/etc/wolbeacon.cfg","wb")
|
||||
if not f then
|
||||
return false
|
||||
end
|
||||
f:write(serial.serialize(cfg))
|
||||
f:close()
|
||||
end
|
||||
|
||||
local function broadcast()
|
||||
for modem in component.list("modem") do
|
||||
component.invoke(modem,"broadcast",cfg.port,cfg.message)
|
||||
end
|
||||
end
|
||||
|
||||
local function loadConfig()
|
||||
local f = io.open("/etc/wolbeacon.cfg","rb")
|
||||
if not f then
|
||||
saveConfig()
|
||||
return false
|
||||
end
|
||||
cfg = serial.unserialize(f:read("*a")) or cfg
|
||||
f:close()
|
||||
end
|
||||
|
||||
function start()
|
||||
loadConfig()
|
||||
if cfg.receive then
|
||||
for modem in component.list("modem") do
|
||||
component.invoke(modem,"setWakeMessage",cfg.message)
|
||||
end
|
||||
else
|
||||
for modem in component.list("modem") do
|
||||
component.invoke(modem,"setWakeMessage",nil)
|
||||
end
|
||||
end
|
||||
if cfg.broadcast then
|
||||
timer = event.timer(cfg.delay, broadcast, math.huge)
|
||||
end
|
||||
end
|
||||
|
||||
function stop()
|
||||
event.cancel(timer)
|
||||
timer = -1
|
||||
end
|
||||
|
||||
function reload()
|
||||
stop()
|
||||
start()
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# WoLBeacon for OpenOS
|
||||
|
||||
WoLBeacon is an OpenOS rc daemon to wake other machines up, and make sure yours can be woken up.
|
||||
|
||||
## Usage
|
||||
|
||||
WoLBeacon can be managed as an rc service:
|
||||
|
||||
```
|
||||
rc wolbeacon start
|
||||
rc wolbeacon stop
|
||||
rc wolbeacon reload
|
||||
rc wolbeacon enable
|
||||
rc wolbeacon disable
|
||||
```
|
||||
|
||||
You will most likely want to start and enable the service.
|
||||
|
||||
## Configuration
|
||||
|
||||
WoLBeacon's configuration file can be found in */etc/wolbeacon.cfg*, containing a number of fields:
|
||||
|
||||
- **broadcast**: Whether to broadcast Wake-on-LAN packets.
|
||||
- **receive**: Whether to configure the local network interfaces to receive Wake-on-LAN messages.
|
||||
- **message**: The Wake-on-LAN message to listen for and broadcast.
|
||||
- **port**: The port to broadcast Wake-on-LAN messages on.
|
||||
- **delay**: The interval between sending Wake-on-LAN messages.
|
@ -1,9 +0,0 @@
|
||||
# WoLBeacon
|
||||
|
||||
WoLBeacon is a piece of software written to wake other computers up, and keep them awake, like force-feeding your friends coffee.
|
||||
|
||||
This is achieved by both setting the wake message for the local machine, and broadcasting wake-on-LAN messages at regular intervals.
|
||||
|
||||
## [WoLBeacon for OpenOS](OpenOS/)
|
||||
|
||||
WoLBeacon is implemented as an rc daemon for OpenOS.
|
10
programs.cfg
10
programs.cfg
@ -128,14 +128,4 @@
|
||||
authors = "Izaya",
|
||||
repo = "tree/master/"
|
||||
},
|
||||
["wolbeacon"] = {
|
||||
files = {
|
||||
["master/WoLBeacon/OpenOS/etc/rc.d/wolbeacon.lua"] = "//etc/rc.d",
|
||||
["master/WoLBeacon/OpenOS/usr/man/wolbeacon"] = "/man",
|
||||
},
|
||||
name = "WoL Beacon",
|
||||
description = "Wake on LAN daemon",
|
||||
authors = "Izaya",
|
||||
repo = "tree/master/"
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user