Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fumiama/command-trigger
Just trigger one command and get its result by HMACed UDP
https://github.com/fumiama/command-trigger
Last synced: 16 days ago
JSON representation
Just trigger one command and get its result by HMACed UDP
- Host: GitHub
- URL: https://github.com/fumiama/command-trigger
- Owner: fumiama
- License: gpl-3.0
- Created: 2022-07-15T05:22:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-19T11:47:27.000Z (over 2 years ago)
- Last Synced: 2024-10-30T17:08:47.014Z (2 months ago)
- Language: Go
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# command-trigger
Just trigger one command and get its result by HMACed UDP## usage
```powershell
-D debug-level log output
-d int
max valid time diff (default 5)
-e string
execute this command on triggered
-g generate a random key and exit
-h display this help
-i int
min execute interval (default 10)
-k string
64 bytes hmac key in base16384 format
-m string
send additional message
-t string
send/recv trigger to this addr:port
-w uint
max wait seconds for reply of executer (default 16)
```## example
> Windows
- trigger
```powershell
go run main.go main_windows.go -t 127.0.0.1:8000 -k "抿淀檆健" -m "hello world"
[INFO] send trigger to 127.0.0.1:8000 : hello world
[INFO] 127.0.0.1:8000 reply: 123
```
- executer
```powershell
go run main.go main_windows.go -t 127.0.0.1:8000 -k "抿淀檆健" -e "cmd /c echo 123"
[INFO] 127.0.0.1:56626 triggered with message: hello world
[INFO] get result: 123
```
> unix
- trigger
```powershell
go run main.go -t 127.0.0.1:8000 -k "抿淀檆健" -m "hello world"
[INFO] send trigger to 127.0.0.1:8000 : hello world
[INFO] 127.0.0.1:8000 reply: 123
```
- executer
```powershell
go run main.go -t 127.0.0.1:8000 -k "抿淀檆健" -e "cmd /c echo 123"
[INFO] 127.0.0.1:56626 triggered with message: hello world
[INFO] get result: 123
```