mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "448cf931630fb895426a22fd9e0212f75b6a5e81" and "3c4149907405a03acc869776e86ca4844312f89e" have entirely different histories.
448cf93163
...
3c41499074
|
@ -54,8 +54,37 @@ function default_settings() {
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
if [[ ! -d /root/Matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -d /opt/matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
msg_error "Update via the Matterbridge UI"
|
|
||||||
|
RELEASE=$(curl -s https://api.github.com/repos/Luligu/matterbridge/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
|
||||||
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
|
msg_info "Stopping ${APP} Service"
|
||||||
|
systemctl stop matterbridge
|
||||||
|
msg_ok "Stopped ${APP} Service"
|
||||||
|
|
||||||
|
msg_info "Updating ${APP} to ${RELEASE}"
|
||||||
|
cd /opt/matterbridge
|
||||||
|
wget -q "https://github.com/Luligu/matterbridge/archive/refs/tags/${RELEASE}.zip"
|
||||||
|
unzip -q ${RELEASE}.zip
|
||||||
|
mv matterbridge-${RELEASE} /opt/matterbridge
|
||||||
|
cd /opt/matterbridge
|
||||||
|
npm ci >/dev/null 2>&1
|
||||||
|
npm run build >/dev/null 2>&1
|
||||||
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
|
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||||
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
rm /opt/${RELEASE}.zip
|
||||||
|
msg_ok "Cleaned"
|
||||||
|
|
||||||
|
msg_info "Starting ${APP} Service"
|
||||||
|
systemctl start matterbridge
|
||||||
|
sleep 1
|
||||||
|
msg_ok "Started ${APP} Service"
|
||||||
|
msg_ok "Updated Successfully!\n"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,17 @@ setting_up_container
|
||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies (Patience)"
|
||||||
$STD apt-get install -y curl
|
$STD apt-get install -y --no-install-recommends \
|
||||||
$STD apt-get install -y sudo
|
build-essential \
|
||||||
$STD apt-get install -y mc
|
unzip \
|
||||||
$STD apt-get install -y gpg
|
curl \
|
||||||
|
sudo \
|
||||||
|
git \
|
||||||
|
make \
|
||||||
|
gnupg \
|
||||||
|
ca-certificates \
|
||||||
|
mc
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setting up Node.js Repository"
|
msg_info "Setting up Node.js Repository"
|
||||||
|
@ -34,8 +40,15 @@ $STD apt-get install -y nodejs
|
||||||
msg_ok "Installed Node.js"
|
msg_ok "Installed Node.js"
|
||||||
|
|
||||||
msg_info "Install Matterbridge"
|
msg_info "Install Matterbridge"
|
||||||
mkdir -p /root/Matterbridge
|
RELEASE=$(curl -s https://api.github.com/repos/Luligu/matterbridge/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
$STD npm install -g matterbridge
|
wget -q "https://github.com/Luligu/matterbridge/archive/refs/tags/${RELEASE}.zip"
|
||||||
|
unzip -q ${RELEASE}.zip
|
||||||
|
mv matterbridge-${RELEASE} /opt/matterbridge
|
||||||
|
rm -R ${RELEASE}.zip
|
||||||
|
cd /opt/matterbridge
|
||||||
|
$STD npm ci
|
||||||
|
$STD npm run build
|
||||||
|
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||||
msg_ok "Installed Matterbridge"
|
msg_ok "Installed Matterbridge"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
|
@ -46,13 +59,16 @@ After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=matterbridge -bridge -service
|
ExecStart=/usr/bin/npm run start:bridge
|
||||||
WorkingDirectory=/root/Matterbridge
|
WorkingDirectory=/opt/matterbridge
|
||||||
StandardOutput=inherit
|
StandardOutput=inherit
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
TimeoutStopSec=30s
|
TimeoutStopSec=30s
|
||||||
|
User=root
|
||||||
|
Environment=PATH=/usr/bin:/usr/local/bin:/opt/matterbridge/bin
|
||||||
|
Environment=NODE_ENV=production
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue