File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,15 @@ function update_script() {
3232 msg_error " No ${APP} Installation Found!"
3333 exit
3434 fi
35- msg_info " Updating ${APP} LXC"
36- apt-get update & > /dev/null
37- apt-get -y upgrade & > /dev/null
38- msg_ok " Updated Successfully"
35+ RELEASE=$( curl -s https://api.github.com/repos/typesense/typesense/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
36+ if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
37+ msg_info " Updating ${APP} LXC"
38+ apt-get update & > /dev/null
39+ apt-get -y upgrade & > /dev/null
40+ msg_ok " Updated Successfully"
41+ else
42+ msg_ok " No update required. ${APP} is already at ${RELEASE} "
43+ fi
3944 exit
4045}
4146
You can’t perform that action at this time.
0 commit comments