Skip to content

Commit 709ae17

Browse files
Update opengist.sh
1 parent 186e392 commit 709ae17

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ct/opengist.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,25 @@ function update_script() {
3232
msg_error "No ${APP} Installation Found!"
3333
exit
3434
fi
35+
msg_info "Stopping Service"
36+
systemctl stop opengist.service
37+
msg_ok "Stopped Service"
3538
RELEASE=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
3639
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
3740
msg_info "Updating ${APP} to v${RELEASE}"
3841
cd /opt
3942
wget -qO "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
4043
rm -rf /opt/opengist
41-
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
44+
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
45+
rm -rf /opt/opengist${RELEASE}-linux-amd64.tar.gz
4246
chmod +x /opt/opengist/opengist
47+
echo "${RELEASE}" >"/opt/${APP}_version.txt"
4348
msg_ok "Updated ${APP} LXC"
49+
50+
msg_info "Starting Service"
51+
systemctl start opengist.service
52+
msg_ok "Started Service"
53+
4454
else
4555
msg_ok "No update required. ${APP} is already at v${RELEASE}."
4656
fi

0 commit comments

Comments
 (0)