diff --git a/ct/alpine-mqtt.sh b/ct/alpine-mqtt.sh new file mode 100644 index 000000000..cf17896e6 --- /dev/null +++ b/ct/alpine-mqtt.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.zigbee2mqtt.io/ + +APP="Alpine-MQTT" +var_tags="${var_tags:-alpine;zigbee;mqtt;smarthome}" +var_disk="${var_disk:-1}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_os="${var_os:-alpine}" +var_version="${var_version:-3.22}" +var_unprivileged="${var_unprivileged:-0}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + if ! apk -e info newt >/dev/null 2>&1; then + apk add -q newt + fi + while true; do + CHOICE=$( + whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --menu "Select option" 11 58 1 \ + "1" "Check for MQTT Updates" 3>&2 2>&1 1>&3 + ) + exit_status=$? + if [ $exit_status == 1 ]; then + clear + exit-script + fi + header_info + case $CHOICE in + 1) + $STD apk -U upgrade + exit + ;; + esac + done +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" diff --git a/install/alpine-mqtt-install.sh b/install/alpine-mqtt-install.sh new file mode 100644 index 000000000..ddea625f3 --- /dev/null +++ b/install/alpine-mqtt-install.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.zigbee2mqtt.io/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Alpine-Mosquitto_Zigbee2MQTT_haBridge" + +# mosquitto +msg_info "Installing Mosquitto" +apk add mosquitto +mosquitto_config=/etc/mosquitto/mosquitto.conf +sed -i -e "s/^#allow_anonymous.*$/allow_anonymous true/" $mosquitto_config +sed -i -e "s/^#listener.*$/listener 1883/" $mosquitto_config +rc-update add mosquitto +rc-service start mosquitto + +# ha-bridge +msg_info "Installing haBridge" +apk add openjdk11 +java --version +mkdir -p /opt/habridge +cd /opt/habridge +release=$( curl -fsSL https://api.github.com/repos/bwssytems/ha-bridge/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q https://github.com/bwssytems/ha-bridge/releases/download/v5.4.1/ha-bridge-${release}.jar +initfile=/etc/init.d/habridge +cat > $initfile <>/etc/conf.d/zigbee2mqtt <