Files
zigbee-stack/scripts/create_password.sh
John Lancaster d45ba97a8f some updates
2024-05-19 17:17:51 -05:00

15 lines
497 B
Bash
Executable File

#!/bin/bash
set -e
SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
REPO_DIR=$(dirname $SCRIPT_DIR)
COMPOSE_FILE=$REPO_DIR/docker-compose.yml
ENV_FILE=$REPO_DIR/.env
echo "Please input the mosquitto password:"
read -s MOSQUITTO_PASSWORD
docker compose -f $COMPOSE_FILE run -it --rm mqtt mosquitto_passwd -b -c /mosquitto/config/pwfile homeassistant $MOSQUITTO_PASSWORD
echo "password: $MOSQUITTO_PASSWORD" > $REPO_DIR/zigbee2mqtt/secret.yaml
chmod 600 $REPO_DIR/zigbee2mqtt/secret.yaml