mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-09 20:58:12 +01:00
Refactor (#14673)
This commit is contained in:
+21
-11
@@ -21,18 +21,28 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -f /etc/mosquitto/conf.d/default.conf ]]; then
|
|
||||||
msg_error "No ${APP} Installation Found!"
|
if [[ ! -f /etc/mosquitto/conf.d/default.conf ]]; then
|
||||||
exit
|
msg_error "No ${APP} Installation Found!"
|
||||||
fi
|
|
||||||
msg_info "Updating ${APP} LXC"
|
|
||||||
$STD apt update
|
|
||||||
$STD apt -y upgrade
|
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
exit
|
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
|
start
|
||||||
|
|||||||
+13
-5
@@ -13,18 +13,26 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Mosquitto MQTT Broker"
|
setup_deb822_repo \
|
||||||
source /etc/os-release
|
"mqtt" \
|
||||||
$STD apt update
|
"https://repo.mosquitto.org/debian/mosquitto-repo.gpg" \
|
||||||
$STD apt -y install mosquitto mosquitto-clients
|
"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 <<EOF >/etc/mosquitto/conf.d/default.conf
|
cat <<EOF >/etc/mosquitto/conf.d/default.conf
|
||||||
allow_anonymous false
|
allow_anonymous false
|
||||||
persistence true
|
persistence true
|
||||||
password_file /etc/mosquitto/passwd
|
password_file /etc/mosquitto/passwd
|
||||||
listener 1883
|
listener 1883
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Installed Mosquitto MQTT Broker"
|
msg_ok "Configured Mosquitto MQTT Broker"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|||||||
Reference in New Issue
Block a user