File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ function update_script() {
2828 exit
2929 fi
3030 if [[ ! -f /opt/${APP} _version.txt ]]; then touch /opt/${APP} _version.txt; fi
31- RELEASE=$( curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep " tag_name" | awk ' {print substr($2, 2 , length($2)-3 ) }' )
32- if [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]] || [[ ! -f /opt/${APP} _version.txt ]]; then
31+ RELEASE=$( curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep " tag_name" | awk ' {print substr($2, 3 , length($2)-4 ) }' )
32+ if [[ " v ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]] || [[ ! -f /opt/${APP} _version.txt ]]; then
3333 msg_info " Stopping ${APP} "
3434 systemctl stop trilium
3535 sleep 1
@@ -40,11 +40,11 @@ function update_script() {
4040 mv /opt/trilium/{db,dump-db} /opt/trilium_backup/
4141 rm -rf /opt/trilium
4242 cd /tmp
43- wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE} /TriliumNextNotes-Server-${RELEASE} -linux-x64.tar.xz
44- tar -xf TriliumNextNotes-Server-${RELEASE} -linux-x64.tar.xz
43+ wget -q https://github.com/TriliumNext/Notes/releases/download/v ${RELEASE} /TriliumNextNotes-Server-v ${RELEASE} -linux-x64.tar.xz
44+ tar -xf TriliumNextNotes-Server-v ${RELEASE} -linux-x64.tar.xz
4545 mv TriliumNextNotes-Server-$RELEASE -linux-x64 /opt/trilium
4646 cp -r /opt/trilium_backup/{db,dump-db} /opt/trilium/
47- echo " ${RELEASE} " > /opt/${APP} _version.txt
47+ echo " v ${RELEASE} " > /opt/${APP} _version.txt
4848 msg_ok " Updated to ${RELEASE} "
4949
5050 msg_info " Cleaning up"
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ msg_ok "Installed Dependencies"
2222
2323msg_info " Setup TriliumNext"
2424cd /opt
25- RELEASE=$( curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep " tag_name" | awk ' {print substr($2, 2 , length($2)-3 ) }' )
26- wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE} /TriliumNextNotes-Server-${RELEASE} -linux-x64.tar.xz
27- tar -xf TriliumNextNotes-Server-${RELEASE} -linux-x64.tar.xz
25+ RELEASE=$( curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep " tag_name" | awk ' {print substr($2, 3 , length($2)-4 ) }' )
26+ wget -q https://github.com/TriliumNext/Notes/releases/download/v ${RELEASE} /TriliumNextNotes-Server-v ${RELEASE} -linux-x64.tar.xz
27+ tar -xf TriliumNextNotes-Server-v ${RELEASE} -linux-x64.tar.xz
2828mv TriliumNextNotes-Server-$RELEASE -linux-x64 /opt/trilium
2929echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
3030msg_ok " Setup TriliumNext"
You can’t perform that action at this time.
0 commit comments