forked from TheWrightServer/ProxmoxVE
Script Update: SnipeIT (#641)
This commit is contained in:
parent
6d307f07a9
commit
df99c30ab3
@ -58,12 +58,13 @@ header_info
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/snipe-it ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -d /opt/snipe-it ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
msg_info "Updating ${APP} LXC"
|
RELEASE=$(curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
|
msg_info "Updating ${APP} to v${RELEASE}"
|
||||||
apt-get update &>/dev/null
|
apt-get update &>/dev/null
|
||||||
apt-get -y upgrade &>/dev/null
|
apt-get -y upgrade &>/dev/null
|
||||||
mv /opt/snipe-it /opt/snipe-it-backup
|
mv /opt/snipe-it /opt/snipe-it-backup
|
||||||
cd /opt
|
cd /opt
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
|
||||||
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" &>/dev/null
|
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" &>/dev/null
|
||||||
unzip -q v${RELEASE}.zip
|
unzip -q v${RELEASE}.zip
|
||||||
mv snipe-it-${RELEASE} /opt/snipe-it
|
mv snipe-it-${RELEASE} /opt/snipe-it
|
||||||
@ -84,6 +85,9 @@ chmod -R 755 /opt/snipe-it
|
|||||||
rm -rf /opt/v${RELEASE}.zip
|
rm -rf /opt/v${RELEASE}.zip
|
||||||
rm -rf /opt/snipe-it-backup
|
rm -rf /opt/snipe-it-backup
|
||||||
msg_ok "Updated ${APP} LXC"
|
msg_ok "Updated ${APP} LXC"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ msg_ok "Set up database"
|
|||||||
msg_info "Installing Snipe-IT"
|
msg_info "Installing Snipe-IT"
|
||||||
cd /opt
|
cd /opt
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||||
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip"
|
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip"
|
||||||
unzip -q v${RELEASE}.zip
|
unzip -q v${RELEASE}.zip
|
||||||
mv snipe-it-${RELEASE} /opt/snipe-it
|
mv snipe-it-${RELEASE} /opt/snipe-it
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"type": "ct",
|
"type": "ct",
|
||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 3000,
|
"interface_port": 80,
|
||||||
"documentation": "https://snipe-it.readme.io/docs/overview",
|
"documentation": "https://snipe-it.readme.io/docs/overview",
|
||||||
"website": "https://snipeitapp.com/",
|
"website": "https://snipeitapp.com/",
|
||||||
"logo": "https://raw.githubusercontent.com/snipe/snipe-it/refs/heads/master/public/img/snipe-logo-bug.png",
|
"logo": "https://raw.githubusercontent.com/snipe/snipe-it/refs/heads/master/public/img/snipe-logo-bug.png",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user