diff --git a/extras/setup/Docker.sh b/extras/setup/Docker.sh new file mode 100755 index 0000000..57af1ae --- /dev/null +++ b/extras/setup/Docker.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +cat <<\EOF >> ~/.profile +alias mqttsub='mqttsub() { mosquitto_sub -v -t "$1#"; }; mqttsub' +alias dockre='dockre() { cat /dev/null > `docker inspect -f "{{json .LogPath}}" $1 | tr -d \"`; docker restart $1; }; dockre' +alias docksh='docksh() { docker exec -it $1 /bin/bash; }; docksh' +alias docklog='docker logs -f' +alias hasssh='docksh homeassistant' +alias hassre='dockre homeassistant' +alias hasslog="docklog homeassistant" +alias hassrl='hassre; hasslog' +EOF + +# Docker +docker run -d --name=homeassistant --privileged --restart=unless-stopped -e TZ=Asia/Shanghai -v /opt/.homeassistant:/config --network=host ghcr.nju.edu.cn/home-assistant/home-assistant:stable diff --git a/extras/setup/Hass.sh b/extras/setup/Hass.sh index 0c2630d..b607e22 100755 --- a/extras/setup/Hass.sh +++ b/extras/setup/Hass.sh @@ -59,4 +59,4 @@ alias hassrl='hassre; hasslog' EOF # Docker -docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=Asia/Shanghai -v /opt/.homeassistant:/config --network=host ghcr.io/home-assistant/home-assistant:stable \ No newline at end of file +docker run -d --name=homeassistant --privileged --restart=unless-stopped -e TZ=Asia/Shanghai -v /opt/.homeassistant:/config --network=host ghcr.nju.edu.cn/home-assistant/home-assistant:stable