Initial upload
This commit is contained in:
49
recipes/services/homeassistant/install.sh
Normal file
49
recipes/services/homeassistant/install.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ensure_root
|
||||
detect_pkg_manager
|
||||
pkg_install curl
|
||||
|
||||
BASE="/srv/docker/services/homeassistant"
|
||||
$SUDO mkdir -p "$BASE/config"
|
||||
cd "$BASE"
|
||||
|
||||
echo ""
|
||||
echo "Starte Installation von Home Assistant (Container-Modus)."
|
||||
|
||||
# docker-compose schreiben
|
||||
$SUDO tee docker-compose.yml >/dev/null <<'EOF'
|
||||
services:
|
||||
homeassistant:
|
||||
image: ghcr.io/home-assistant/home-assistant:stable
|
||||
container_name: homeassistant
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
volumes:
|
||||
- ./config:/config
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
EOF
|
||||
|
||||
$SUDO docker compose up -d
|
||||
|
||||
log "Home Assistant wurde installiert."
|
||||
log "Web UI (wenn kein Proxy): http://<server-ip>:8123"
|
||||
log "Konfiguration: $BASE/config/"
|
||||
|
||||
echo ""
|
||||
read -p "Soll ein NGINX Proxy-Pfad eingerichtet werden? (y/n): " PROXY
|
||||
|
||||
if [[ "$PROXY" == "y" || "$PROXY" == "Y" ]]; then
|
||||
PROXY_SCRIPT="/srv/docker/system/nginx-proxy-path/install.sh"
|
||||
|
||||
if [ ! -f "$PROXY_SCRIPT" ]; then
|
||||
log "Fehler: nginx-proxy-path nicht installiert."
|
||||
log "Bitte zuerst das Rezept 'nginx-proxy-path' installieren."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Bitte Proxy-Pfad einrichten:"
|
||||
bash "$PROXY_SCRIPT"
|
||||
fi
|
||||
Reference in New Issue
Block a user