Skip to content

Commit

Permalink
Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonsm committed Nov 20, 2023
1 parent 3b60539 commit 8334608
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions extras/setup/Docker.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion extras/setup/Hass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 8334608

Please sign in to comment.