Executing shell commands via HTTP server
Project description
shell2http
HTTP-server to execute shell commands. Designed for development, prototyping or remote control. Settings through two command line arguments, path and shell command. By default bind to :8080. with shell2udp it runs with minimal latency.
Usage
shell2http [-h] [-form] [-no-index] [-add-exit] [-output] [-sse] [-p PORT] ["shell command" for /] /path "shell command" /path2 "shell command2" ...
positional arguments:
command
optional arguments:
-h, --help show this help message and exit
-form parse query into environment vars
-no-index do not generate index page
-add-exit add /exit command
-output send back output
-sse use Server Sent Events
-p PORT, --port PORT
Install
pip install shell2http
Examples
Windows
shell2http 'shutdown -s -t 0'
shell2http 'shutdown -s -t 0' /beep 'echo ^G'
shell2http --port 3306 /beep 'powershell -command [Console]::Beep(440,2000)'
Linux
shell2http 'notify-send Hello root'
shell2http -p3000 'notify-send Hello root' /path 'canberra-gtk-play -i desktop-login'
shell2http -p3000 /path 'canberra-gtk-play -i desktop-login'
shell2http -output /info 'uname -a'
shell2http -output -sse /ping 'ping -c4 8.8.8.8'
shell2http -add-exit pwd
http://localhost:8080/form?from=10&to=100
shell2http -output -form /form 'echo $v_from, $v_to'
Acknowledgements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shell2http-2.7.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file shell2http-2.7.tar.gz
.
File metadata
- Download URL: shell2http-2.7.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f648ab5eccb428a1ca8084ac9d65c60adcb7f778698e15f94228325dd4de3b0b |
|
MD5 | d7d90f6ddcf789688481294b2f3a90f2 |
|
BLAKE2b-256 | 02e5ecb0bcbe36913c98b0a93a8ce5e40a87434eba7b6421984a0aa75ab9edf6 |
File details
Details for the file shell2http-2.7-py3-none-any.whl
.
File metadata
- Download URL: shell2http-2.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46c8f255994f471b50b64a36fb64242474f12b8a9d0905e31c02453d9a3affb |
|
MD5 | 4d0bfcd7daa27577a0bc52947a9197da |
|
BLAKE2b-256 | c41bb84ef8feb99ea41278d066f4d0ec488b469a06c34c8ab7a1874b457c15ea |