Trigger for shell commands

Hello,

I’m trying to create a script or something to trigger a shell command. (like ‘sudo service restart X’)

I did it with a switch, but I do not want a switch because it has 2 commands (on and off), I want just a button ‘Activate’ or something similar to trigger just one command.

Can you give me a short example of how I can do something like this?

Thanks!

test_script:
  alias: 'script to run shell command'
  sequence:
    service: shell_command.test

Not sure if this is what you are talking about, but it would call the shell command for you.

1 Like

The way the script appears on the frontend can be customized.

Check here.

1 Like