jeffeb3 / v1pi

Preconfigured PI useful for users of the V1Engineering machines.
GNU General Public License v3.0
99 stars 18 forks source link

Add poweroff to cnc.js or landing page #6

Open jeffeb3 opened 5 years ago

jeffeb3 commented 5 years ago

You can't poweroff from cnc.js.

TheKyleJohnson90 commented 4 years ago

You can add these via the Settings -> Commands feature in cncjs.

Example: title: Reboot commands: sudo reboot

heymish commented 2 years ago

image

Just needs to add to the .cncrc. I will add a PR for this once the other PR is merged.

,
    "commands": [
    {
      "title": "Reboot",
      "commands": "sudo shutdown -r now"
    },
    {
      "title": "Shutdown",
      "commands": "sudo shutdown -h now"
    }
  ]

It uses the Octopi commands which have been added to /etc/sudoers.dso it all just happily works.

I have tested this. It also works if the Pi user has a password set.