2
0
mirror of https://github.com/pikvm/pikvm synced 2024-11-14 18:12:53 +00:00
This commit is contained in:
Maxim Devaev 2021-10-24 12:55:11 +03:00
parent 3ea8cb3bf5
commit f9d35dd4b5

View File

@ -280,6 +280,42 @@ Some rules and customization options:
``` ```
### CMD
??? note "Click to view"
The `cmd` driver allows you to run custom command on PiKVM OS.
!!! note
This driver does not support bash operators, that is, it is a direct call to commands with arguments. For more complex cases, write your own shell scripts.
Commands are executed from the user `kvmd`. If you want to run the command as root, then you need to configure `sudo`. Example of the `/etc/sudoers.d/custom_commands`:
```sudoers
kvmd ALL=(ALL) NOPASSWD: /usr/bin/reboot
```
Example of the `/etc/kvmd/override.yaml`:
```yaml
kvmd:
gpio:
drivers:
reboot:
type: cmd
cmd: [/usr/bin/sudo, reboot]
scheme:
reboot_button:
driver: reboot
pin: 0
mode: output
switch: false
view:
table:
- ["reboot|confirm|Reboot PiKVM"]
```
### PWM ### PWM
??? note "Click to view" ??? note "Click to view"
The `pwm` driver allows you to use [some GPIO pins](https://pinout.xyz/pinout/pwm) on the Raspberry Pi for PWM. The `pwm` driver allows you to use [some GPIO pins](https://pinout.xyz/pinout/pwm) on the Raspberry Pi for PWM.