mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-04-19 08:05:13 +00:00
Fix TriliumNotes release handling (#3160)
This commit is contained in:
parent
58132fdb1d
commit
4aa8578b7d
@ -28,8 +28,8 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt; fi
|
||||
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ "v${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop trilium
|
||||
sleep 1
|
||||
@ -40,11 +40,11 @@ function update_script() {
|
||||
mv /opt/trilium/{db,dump-db} /opt/trilium_backup/
|
||||
rm -rf /opt/trilium
|
||||
cd /tmp
|
||||
wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE}/TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
|
||||
tar -xf TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
|
||||
wget -q https://github.com/TriliumNext/Notes/releases/download/v${RELEASE}/TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
|
||||
tar -xf TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
|
||||
mv TriliumNextNotes-Server-$RELEASE-linux-x64 /opt/trilium
|
||||
cp -r /opt/trilium_backup/{db,dump-db} /opt/trilium/
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
echo "v${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated to ${RELEASE}"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
|
@ -22,9 +22,9 @@ msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setup TriliumNext"
|
||||
cd /opt
|
||||
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE}/TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
|
||||
tar -xf TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
|
||||
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
wget -q https://github.com/TriliumNext/Notes/releases/download/v${RELEASE}/TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
|
||||
tar -xf TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
|
||||
mv TriliumNextNotes-Server-$RELEASE-linux-x64 /opt/trilium
|
||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||
msg_ok "Setup TriliumNext"
|
||||
|
Loading…
x
Reference in New Issue
Block a user