Files
zigbee-stack/scripts/create_password.sh
John Lancaster e7a6a5ab1f script updates
2024-09-29 21:50:12 +00:00

17 lines
506 B
Bash
Executable File

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