diff options
author | Dennis Eriksen <d@ennis.no> | 2023-04-03 10:40:15 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-04-03 10:40:15 +0200 |
commit | e55821f20e6b8d52b23c5bcd2ecaa585ac99e095 (patch) | |
tree | e0670846e60b3aec26319ce5af321551195214ed /run.sh | |
parent | rewriting script (diff) | |
download | energyscripts-e55821f20e6b8d52b23c5bcd2ecaa585ac99e095.tar.gz |
adding service for esphomeapi, and allowing run.sh to take arguments
Diffstat (limited to 'run.sh')
-rwxr-xr-x | run.sh | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -8,10 +8,13 @@ setopt all_export source .env unsetopt all_export -if [[ -f $1 ]]; then - ./venv/bin/python3 $1 -elif [[ -f scripts/$1 ]]; then - ./venv/bin/python3 scripts/$1 +script=$1 +shift + +if [[ -f $script ]]; then + ./venv/bin/python3 $script $@ +elif [[ -f scripts/$script ]]; then + ./venv/bin/python3 scripts/$script $@ else print -u2 "Computer says no" && exit 1 fi |