diff --git a/ct/mqtt.sh b/ct/mqtt.sh index 0db240421..2dcb5f823 100644 --- a/ct/mqtt.sh +++ b/ct/mqtt.sh @@ -21,18 +21,28 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/mosquitto/conf.d/default.conf ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP} LXC" - $STD apt update - $STD apt -y upgrade - msg_ok "Updated successfully!" + header_info + check_container_storage + check_container_resources + + if [[ ! -f /etc/mosquitto/conf.d/default.conf ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if [[ ! -f /etc/apt/sources.list.d/mqtt.sources ]]; then + setup_deb822_repo \ + "mqtt" \ + "https://repo.mosquitto.org/debian/mosquitto-repo.gpg" \ + "https://repo.mosquitto.org/debian" \ + "trixie" + fi + + msg_info "Updating MQTT" + $STD apt update + $STD apt upgrade -y + msg_ok "Updated successfully!" + exit } start diff --git a/install/mqtt-install.sh b/install/mqtt-install.sh index 32dd8dc8f..23037faad 100644 --- a/install/mqtt-install.sh +++ b/install/mqtt-install.sh @@ -13,18 +13,26 @@ setting_up_container network_check update_os -msg_info "Installing Mosquitto MQTT Broker" -source /etc/os-release -$STD apt update -$STD apt -y install mosquitto mosquitto-clients +setup_deb822_repo \ + "mqtt" \ + "https://repo.mosquitto.org/debian/mosquitto-repo.gpg" \ + "https://repo.mosquitto.org/debian" \ + "trixie" +msg_info "Installing Mosquitto MQTT Broker" +$STD apt install -y \ + mosquitto \ + mosquitto-clients +msg_ok "Installed Mosquitto MQTT Broker" + +msg_info "Configuring Mosquitto MQTT Broker" cat </etc/mosquitto/conf.d/default.conf allow_anonymous false persistence true password_file /etc/mosquitto/passwd listener 1883 EOF -msg_ok "Installed Mosquitto MQTT Broker" +msg_ok "Configured Mosquitto MQTT Broker" motd_ssh customize