https://github.com/nixilla/pccontrol
Small PC control app for shutting down linux machine
https://github.com/nixilla/pccontrol
Last synced: 2 months ago
JSON representation
Small PC control app for shutting down linux machine
- Host: GitHub
- URL: https://github.com/nixilla/pccontrol
- Owner: nixilla
- Created: 2016-03-03T14:29:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T15:12:44.000Z (about 9 years ago)
- Last Synced: 2025-02-08T21:16:57.351Z (4 months ago)
- Language: PHP
- Size: 54.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PC shutdown app
[](https://travis-ci.org/nixilla/PCControl)
Exposes API to shutdown PC remotely. Very useful when you have kids.
## How it works?
```
curl -v http://host:port> GET / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: host
> Accept: */*
>
< HTTP/1.1 200 OK
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Set-Cookie: PHPSESSID=0ntrbvh2j1a7qp4shrrtscohe0; path=/; HttpOnly
< Cache-Control: no-cache
< X-Debug-Token: 04c5a2
< X-Debug-Token-Link: /_profiler/04c5a2
< Date: Thu, 03 Mar 2016 14:23:26 GMT
<{"status":"running","hostname":"ubuntu-14","boottime":"about 1 hour ago","token":"b47f6a56070038bc7c6d1411b21ff1bfc14cef8b26c534a0ea488c1bc44d1103"}
curl -v http://host:port/ -X POST -H "Content-Type: application/json" \
--data '{"token":"b47f6a56070038bc7c6d1411b21ff1bfc14cef8b26c534a0ea488c1bc44d1103"}' \
--cookie "PHPSESSID=0ntrbvh2j1a7qp4shrrtscohe0"> POST / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: host
> Accept: */*
> Cookie: PHPSESSID=0ntrbvh2j1a7qp4shrrtscohe0
> Content-Type: application/json
> Content-Length: 76
>
* upload completely sent off: 76 out of 76 bytes
< HTTP/1.1 200 OK
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-cache
< X-Debug-Token: 84ce29
< X-Debug-Token-Link: /_profiler/84ce29
< Date: Thu, 03 Mar 2016 14:26:45 GMT
<{"status":"shutting down"}
```