Node/Express server for https://github.com/EkaanshArora/remote-shutdown-app to trigger shutdown, restart and sleep desktop commands from your phone.
Should work on Mac, Windows and Linux. You'll need to launch the service as a superuser to have necessary privileges to execute shutdown command.
There's a version with network discovery using MDNS. You'll need to compile MDNS for your system to use it. Use the mdns branch of the app.
- Install Node.js and NPM
- Download the project and navigate to the folder
- Install dependencies
npm i
- Start the server
npm start
I use pm2
- Install pm2 globally
npm i -g pm2
- Start the server in the project directory
pm2 start index.js --name RemoteShutdownService
- Configure autostart (optional)
pm2 autostart
.- On Windows you can add
pm2 resurrect
to astart.cmd
file and add it to your registry atHKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
to launch the command on startup
- On Windows you can add
- Save the current running tasks for autostart
pm2 save
Listens on port: 5001
with password: e
by default
You can configure this in index.js
TODO:
- Tests
- One click executable
I put this together in a few hours, please open a PR if you find bugs.