LeSysBot docs

Package version

not declared

Requires on PATH

nothing

Python dependencies

none

Install#

Nothing to do — this package ships inside LeSysBot and is available as soon as the installer finishes.

To copy it somewhere else, or pin it into another machine's tools dir:

shell
lesysbot install lesysbot/lesysbot/tools/power

Tools#

This package exposes 3 tools.

reboot()#

asks to confirm

Restart the machine one minute from now.

Parameters

Takes no parameters.

Confirmation prompt

⚠️ This will REBOOT the machine in 1 minute. Proceed?

power_off()#

asks to confirm

Shut the machine down one minute from now.

Parameters

Takes no parameters.

Confirmation prompt

⚠️ This will POWER OFF the machine in 1 minute. Proceed?

cancel_shutdown()#

asks to confirm

Cancel a pending reboot or shutdown before the timer expires.

Parameters

Takes no parameters.

Confirmation prompt

Cancel the pending shutdown/reboot?

Notes#

  • The one-minute delay is deliberate: it gives the chat reply time to reach you before the machine goes down, and it leaves a window to run cancel_shutdown if you change your mind.
  • The shutdown is scheduled with shutdown(8). On systemd distributions that goes through logind under the same polkit rules as systemctl poweroff, so it runs as your normal user — no sudo, no setup.
  • About ten seconds before the machine actually goes down, LeSysBot pushes a separate heads-up message, so you know the cancellation window has closed.

Source#

Every package is a folder holding a README.md and a tool.py. Read this one on GitHub: lesysbot/lesysbot/tools/power.

To write your own, see Writing tools.