#!/bin/bash
#
# This script is used to change the mqtt password
#
# $1 = the new password
#
# (C) Copyright 2020-2022, Bogen Communications LLC. All rights reserved.
#
if [ "$#" -lt 1 ]; then
	exit 1
else
	NEW_PWD=$1
	MQTT_DIR=/etc/mosquitto
	MQTT_PWD_FILE=$MQTT_DIR/mqtt_pwd
	echo "$NEW_PWD" > $MQTT_PWD_FILE
fi

exit 0
