Comments (4)
Hey.
I see.
At first i was using a (configurable) command but it wasn't working well on windows so i switched on windows to a DLL API call instead (but it's still configurable for linux).
I'll see how i can restore the possibility to configure the executed command on windows (that way you should then be able to use a "shutdown" command instead of a "sleep" one).
from sleep-on-lan.
Thanks.
Issuing a windows DLL API call to perform a shutdown is also OK.
Sure, I could fork the project and just change the line 15 in sleep-on-lan/src/main/go/sol/sleeper_windows.go, but then we would have two separate projects, one for sleep and the other for shutdown, where it would be best if it could be a single program and just a config line 'shutdown=1' that would do shutdown instead of sleep.
In that way, the user can experiment and try both approaches.
I think I could do it, if you wish, but then I would just kindly ask you to instruct me about how to compile it.
from sleep-on-lan.
Yep.
I'm about to commit a modification that won't change anything by default, but that will allow to customize the command executed (and also to register new additionnal commands if needed).
In your case you'll have to configure the sol.json configuration file with something like :
{
"Listeners" : ["UDP:9", "UDP:7", "HTTP:8009" ],
"LogLevel" : "INFO",
"Commands" : [
{
"Operation" : "halt",
"Command" : "C:\\Windows\\System32\\Shutdown.exe -s -t 0"
}
]
}
With only one command defined, that command will be used by default (and thus will react to magic packets).
This operation will also be published (if an HTTP listener is defined) on the http://<IP>:<HTTP_PORT>/halt
URL if you want / need to call it from a remote system through http (with curl or wget or anything else).
I'm not willing to have in the configuration "shutdown = 1" or something like that, because if someone needs someday an "hibernate-on-sleep" or anything else, it would then be necessary to deal with all behaviors in code (for all platforms). The "sleep-on-lan behavior" by default + the possibility to customize anything else if needed, as generic commands, seems less restrictive.
from sleep-on-lan.
Hi Serge,
Thank you very much for your quick upgrades.
Unfortunately, I can't make it work.
from sleep-on-lan.
Related Issues (20)
- New command allowing to generate the whole configuration from code
- Switch logging framework to logrus
- Add missing target platform
- add commands doesn't work HOT 12
- Only allow expected command types in custom commands definition
- Log file or event log on Windows? HOT 2
- Incorrect example for Commands? HOT 3
- Have better "default configuration" generated
- Split the ZIP distribution into one archive per platform
- Split README.md into separated pages
- New --verbose parameter
- Extra default filenames
- Logs where not displaying timestamps in line with system's timezone
- No response for HTTP sleep HOT 2
- Have extra delay before executing command HOT 3
- PC sleeps immediately after Wake on Lan after having used sleep on lan HOT 5
- Wake on LAN works strange when service work HOT 1
- Create non-console version, so conhost.exe doesn't also need to run HOT 3
- VirusTotal scan results HOT 1
- Build binaries for x86 architecture HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sleep-on-lan.