Handy script for while building my dashboards

I run in a dockerized environment, and am just starting with the HAD. I already got tired of docker restart each time I changed something.

I installed inotify-tools on my linux box:
sudo apt install inotify-tools

and now have a script:

#!/bin/sh

cd /home/jamie/had-conf

while inotifywait -qqre modify "./dashboards/"
do
    echo "Change detected"
    docker rm -f appdaemon
    docker run --name=appdaemon -d   -p 5050:5050   --volume /home/jamie/had-conf:/conf myappdaemon
done

I enabled a samba share, and now I just save the dashboard and it automagically restarts for me.

There might be an easier way, but this works :smiley:

And a side note, at least on a mac - if you have Xcode installed you can use the simulator program to get safari running your dashboard (don’t judge the dashboard, I am just trying things):

your dashboards should be outside the docker, so you dont need to rebuild.
and then you can use the recompile settings to automaticly get recompiled dashboards.

They are in fact - I swore that they didn’t update previously, maybe I had something set wrong and fixed it at some point, because now they update fine

Thanks!

1 Like