Refactor handling with folders in the ps5-mqtt script

This commit is contained in:
liecno 2025-01-04 12:13:12 +01:00
parent e2b8e9a41d
commit 23008bf37b
2 changed files with 8 additions and 11 deletions

View File

@ -42,12 +42,11 @@ function update_script() {
msg_ok "Stopped service"
msg_info "Updating PS5-MQTT to ${RELEASE}"
cd ~
wget -q https://github.com/FunkeyFlo/ps5-mqtt/archive/refs/tags/${RELEASE}.tar.gz
tar zxf ${RELEASE}.tar.gz
wget -P /tmp -q https://github.com/FunkeyFlo/ps5-mqtt/archive/refs/tags/${RELEASE}.tar.gz
rm -rf /opt/ps5-mqtt
mv ps5-mqtt-* /opt/ps5-mqtt
rm ${RELEASE}.tar.gz
tar zxf /tmp/${RELEASE}.tar.gz -C /opt
mv /opt/ps5-mqtt-* /opt/ps5-mqtt
rm /tmp/${RELEASE}.tar.gz
echo ${RELEASE} > /opt/ps5-mqtt_version.txt
msg_ok "Updated PS5-MQTT"
@ -60,7 +59,6 @@ function update_script() {
msg_info "Starting service"
systemctl start ps5-mqtt
msg_ok "Started service"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi

View File

@ -27,9 +27,9 @@ msg_ok "Installed Dependencies"
RELEASE=$(curl -s https://api.github.com/repos/FunkeyFlo/ps5-mqtt/releases/latest | jq -r '.tag_name')
msg_info "Installing PS5-MQTT"
wget -q https://github.com/FunkeyFlo/ps5-mqtt/archive/refs/tags/${RELEASE}.tar.gz
tar zxf ${RELEASE}.tar.gz
mv ps5-mqtt-* /opt/ps5-mqtt
wget -P /tmp -q https://github.com/FunkeyFlo/ps5-mqtt/archive/refs/tags/${RELEASE}.tar.gz
tar zxf /tmp/${RELEASE}.tar.gz -C /opt
mv /opt/ps5-mqtt-* /opt/ps5-mqtt
echo ${RELEASE} > /opt/ps5-mqtt_version.txt
cd /opt/ps5-mqtt/ps5-mqtt/
$STD npm install
@ -94,8 +94,7 @@ motd_ssh
customize
msg_info "Cleaning up"
cd /
$STD apt-get -y autoremove
$STD apt-get -y autoclean
rm ${RELEASE}.tar.gz
rm /tmp/${RELEASE}.tar.gz
msg_ok "Cleaned"