From a28eb2fd46d2798d4e8b16287a61d49795059839 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 11 Aug 2024 08:34:02 -0400 Subject: [PATCH] Update matterbridge-install.sh refactor fixes https://github.com/tteck/Proxmox/issues/3499 --- install/matterbridge-install.sh | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/install/matterbridge-install.sh b/install/matterbridge-install.sh index 47948471..bac8578f 100644 --- a/install/matterbridge-install.sh +++ b/install/matterbridge-install.sh @@ -15,17 +15,11 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies (Patience)" -$STD apt-get install -y --no-install-recommends \ - build-essential \ - unzip \ - curl \ - sudo \ - git \ - make \ - gnupg \ - ca-certificates \ - mc +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +$STD apt-get install -y gpg msg_ok "Installed Dependencies" msg_info "Setting up Node.js Repository" @@ -40,15 +34,7 @@ $STD apt-get install -y nodejs msg_ok "Installed Node.js" msg_info "Install Matterbridge" -RELEASE=$(curl -s https://api.github.com/repos/Luligu/matterbridge/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -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 +$STD npm install -g matterbridge msg_ok "Installed Matterbridge" msg_info "Creating Service" @@ -59,16 +45,13 @@ After=network-online.target [Service] Type=simple -ExecStart=/usr/bin/npm run start:bridge -WorkingDirectory=/opt/matterbridge +ExecStart=matterbridge -bridge -service +WorkingDirectory=/root/Matterbridge StandardOutput=inherit StandardError=inherit Restart=always RestartSec=10s TimeoutStopSec=30s -User=root -Environment=PATH=/usr/bin:/usr/local/bin:/opt/matterbridge/bin -Environment=NODE_ENV=production [Install] WantedBy=multi-user.target