Skip to content

nodejs app to run as a service to listen for remote shutdown commands from a mobile app

Notifications You must be signed in to change notification settings

EkaanshArora/remote-shutdown-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Remote Shutdown Service

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.

How to use

  • Install Node.js and NPM
  • Download the project and navigate to the folder
  • Install dependencies npm i
  • Start the server npm start

How to setup background task and autostart

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 a start.cmd file and add it to your registry at HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run to launch the command on startup
  • 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.

About

nodejs app to run as a service to listen for remote shutdown commands from a mobile app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published