What module to use to execute bash file?
-
- Posts: 23
- Joined: 06 Sep 2018 13:54
What module to use to execute bash file?
I've written some .sh files to run specific commands. I know how to execute them from PUTTY when I ssh into the system, but can't figure out which module and what is the command to run from inside the zway server program. It's a novice question, but any help would be appreciated. Thanks.
Re: What module to use to execute bash file?
Use the App - Code device
put your command in the action area
e.g. system("echo IRCODE STANDBY | telnet 192.168.1.10 31339")
you also need to allow the command in .syscommands
just add your command to the list, like echo, or sudo echo
nano /opt/z-way-server/automation/.syscommands
I moved my executables to this folder /usr/local/bin/ Saves having to tell it the full path. Raspberry already has this path set.
Use this command in ssh to watch and find the errors:-
tail -f /var/log/z-way-server.log | bash ./colorize-log.sh -c -q -z core
put your command in the action area
e.g. system("echo IRCODE STANDBY | telnet 192.168.1.10 31339")
you also need to allow the command in .syscommands
just add your command to the list, like echo, or sudo echo
nano /opt/z-way-server/automation/.syscommands
I moved my executables to this folder /usr/local/bin/ Saves having to tell it the full path. Raspberry already has this path set.
Use this command in ssh to watch and find the errors:-
tail -f /var/log/z-way-server.log | bash ./colorize-log.sh -c -q -z core
Raspi 4 - (Buster - 32 Bit) Zwave Version 4.1.1, Raz 7 Pro, Serial API Version: 07.38
-
- Posts: 23
- Joined: 06 Sep 2018 13:54
Re: What module to use to execute bash file?
Awesome. Thanks for the info. I've been playing around with it this weekend. I created an executable shell script and it is located in /usr/local/bin/. It works when I put sudo kitchen_night.sh in a command line. But I need a little help from there.
I created a code device with the line system("sudo kitchen_night.sh"). Is that correct?
Also, what is the exact line I add to .syscommands file to make it work?
Thanks in advance.
I created a code device with the line system("sudo kitchen_night.sh"). Is that correct?
Also, what is the exact line I add to .syscommands file to make it work?
Thanks in advance.
Re: What module to use to execute bash file?
You need to add this line:
sudo kitchen_night.sh
sudo kitchen_night.sh