I used to have an automation that runs a shell script at midnight to push changes to git. Some of the latest HA updates most have broken something as it no longer works.
#!/bin/bash
date >> /config/git-last.txt
cd /config
git add .
git status
# Commit changes with message with current date stamp
git commit -m "config files on `date +'%d-%m-%Y %H:%M:%S'`"
# Push changes towards GitHub
git push -u origin main
exit
Sure!!!
You can use “run” file to create your own bash script, manage script I/O and choose a way to give feedback to HA!
…
But, I’d like to understand why?! Why you want to do this?! STDIN controls was not removed from HA but only from SSH addon! The thread in which you have asked this insane question is related to SSH and their breaking change…
I am sorry: I have copy and paste wrong code from model editor in HA used for testing. In automation & script the addon code was correctly wrote.
I apologize for the misunderstanding in std-in link description referred to SSH add-on and not not HA.
I have used your add-oin from oldest HA release without problem: SIP client was registered on my FritzBox router that provide SIP connectivity: after HA udate to last GA rel 2021.12.10, add-on stop working: the problem was related to my google account for TTS service. I have to investigate on it.
Many thanks for your help.
Hi is this still working for you? I am trying to do the same thing, even from the same original source blog and found this thread while troubleshooting.
My script works fine manually but I can’t get the shell_command.push_to_github to work in an automation.
The trouble I find is that other add-ons that implement stdin controls may not run the same commands as ssh.
In particular, I have an script that runs docker commands in influxdb add-on, to generate a daily backup, and copy the backup into homeassistant docker. But neither homeassitant or influxdb containers implement docker commands, as SSH & Web Terminal add-on does.
I recently updated ssh add-on and, obviously, the script, that have been running for months, stopped working.