File tree Expand file tree Collapse file tree 2 files changed +7
-22
lines changed
Expand file tree Collapse file tree 2 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -28,28 +28,19 @@ function update_script() {
2828 msg_error " No ${APP} Installation Found!"
2929 exit
3030 fi
31-
3231 RELEASE=$( curl -fsSL https://api.github.com/repos/glanceapp/glance/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
33- if [[ ! -f /opt/ ${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/ ${APP} _version.txt ) " ]]; then
32+ if [[ " ${RELEASE} " != " $( cat ~ /.glance 2> /dev/null ) " ]] || [[ ! -f ~ /.glance ]]; then
3433 msg_info " Stopping Service"
3534 systemctl stop glance
3635 msg_ok " Stopped Service"
3736
38- msg_info " Updating ${APP} to v${RELEASE} "
39- cd /opt
40- curl -fsSL " https://github.com/glanceapp/glance/releases/download/v${RELEASE} /glance-linux-amd64.tar.gz" -o $( basename " https://github.com/glanceapp/glance/releases/download/v${RELEASE} /glance-linux-amd64.tar.gz" )
41- rm -rf /opt/glance/glance
42- tar -xzf glance-linux-amd64.tar.gz -C /opt/glance
43- echo " ${RELEASE} " > " /opt/${APP} _version.txt"
44- msg_ok " Updated ${APP} to v${RELEASE} "
37+ rm -f /opt/glance/glance
38+ fetch_and_deploy_gh_release " glance" " glanceapp/glance" " prebuild" " latest" " /opt/glance" " glance-linux-amd64.tar.gz"
4539
4640 msg_info " Starting Service"
4741 systemctl start glance
4842 msg_ok " Started Service"
4943
50- msg_info " Cleaning up"
51- rm -rf /opt/glance-linux-amd64.tar.gz
52- msg_ok " Cleaned"
5344 msg_ok " Updated Successfully"
5445 else
5546 msg_ok " No update required. ${APP} is already at v${RELEASE} ."
Original file line number Diff line number Diff line change @@ -13,12 +13,9 @@ setting_up_container
1313network_check
1414update_os
1515
16- msg_info " Installing Glance"
17- RELEASE=$( curl -fsSL https://api.github.com/repos/glanceapp/glance/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
18- cd /opt
19- curl -fsSL " https://github.com/glanceapp/glance/releases/download/v${RELEASE} /glance-linux-amd64.tar.gz" -o " glance-linux-amd64.tar.gz"
20- mkdir -p /opt/glance
21- tar -xzf glance-linux-amd64.tar.gz -C /opt/glance
16+ fetch_and_deploy_gh_release " glance" " glanceapp/glance" " prebuild" " latest" " /opt/glance" " glance-linux-amd64.tar.gz"
17+
18+ msg_info " Configuring Glance"
2219cat << EOF >/opt/glance/glance.yml
2320pages:
2421 - name: Startpage
3936 - title: Helper Scripts
4037 url: https://github.com/community-scripts/ProxmoxVE
4138EOF
42-
43- echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
44- msg_ok " Installed Glance"
39+ msg_ok " Configured Glance"
4540
4641msg_info " Creating Service"
4742service_path=" /etc/systemd/system/glance.service"
@@ -67,7 +62,6 @@ motd_ssh
6762customize
6863
6964msg_info " Cleaning up"
70- rm -rf /opt/glance-linux-amd64.tar.gz
7165$STD apt-get -y autoremove
7266$STD apt-get -y autoclean
7367msg_ok " Cleaned"
You can’t perform that action at this time.
0 commit comments