@@ -6,7 +6,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m
66# Source: https://snipeitapp.com/
77
88APP=" SnipeIT"
9- var_tags=" assat -management;foss"
9+ var_tags=" asset -management;foss"
1010var_cpu=" 2"
1111var_ram=" 2048"
1212var_disk=" 4"
@@ -27,13 +27,20 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30- RELEASE=$( curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) } ' )
30+ RELEASE=$( curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep ' "tag_name"' | sed -E ' s/.*"tag_name": "v([^"]+).*/\1/ ' )
3131 if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
32+ msg_info " Stopping Services"
33+ systemctl stop nginx
34+ msg_ok " Services Stopped"
35+
3236 msg_info " Updating ${APP} to v${RELEASE} "
3337 $STD apt-get update
3438 $STD apt-get -y upgrade
3539 mv /opt/snipe-it /opt/snipe-it-backup
36- cd /opt
40+ temp_file=$( mktemp)
41+ wget -q " https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE} .tar.gz" -O $temp_file
42+ tar zxf $temp_file
43+ mv snipe-it-${RELEASE} /opt/snipe-it
3744 $STD wget -q " https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE} .zip"
3845 unzip -q v${RELEASE} .zip
3946 mv snipe-it-${RELEASE} /opt/snipe-it
@@ -53,9 +60,13 @@ function update_script() {
5360 chmod -R 755 /opt/snipe-it
5461 rm -rf /opt/v${RELEASE} .zip
5562 rm -rf /opt/snipe-it-backup
56- msg_ok " Updated ${APP} LXC"
63+ msg_ok " Updated ${APP} "
64+
65+ msg_info " Starting Service"
66+ systemctl start nginx
67+ msg_ok " Started Service"
5768 else
58- msg_ok " No update required. ${APP} is already at v${RELEASE} . "
69+ msg_ok " No update required. ${APP} is already at v${RELEASE} "
5970 fi
6071 exit
6172}
@@ -67,4 +78,4 @@ description
6778msg_ok " Completed Successfully!\n"
6879echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
6980echo -e " ${INFO}${YW} Access it using the following URL:${CL} "
70- echo -e " ${TAB}${GATEWAY}${BGN} http://${IP}${CL} "
81+ echo -e " ${TAB}${GATEWAY}${BGN} http://${IP}${CL} "
0 commit comments