mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-09 17:29:16 +00:00
Compare commits
No commits in common. "456751e7ccc7755e70f2fc5a402445270e823162" and "8bb0424acdec806ec2b550a7201d767381eca641" have entirely different histories.
456751e7cc
...
8bb0424acd
@ -25,40 +25,26 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/opengist ]]; then
|
if [[ ! -f /opt/opengist/opengist ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Stopping Service"
|
msg_info "Updating ${APP} LXC"
|
||||||
systemctl stop opengist.service
|
LATEST_URL=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | jq -r '.assets[] | select(.name | contains("linux-amd64.tar.gz")).browser_download_url')
|
||||||
msg_ok "Stopped Service"
|
wget "$LATEST_URL"
|
||||||
apt-get update &>/dev/null
|
mv opengist*.tar.gz opengist.tar.gz
|
||||||
apt-get upgrade &>/dev/null
|
tar -xf opengist.tar.gz
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
mv opengist/opengist /opt/opengist/opengist
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
mv opengist/config.yml /opt/opengist/config.yml
|
||||||
msg_info "Updating ${APP} to v${RELEASE}"
|
|
||||||
cd /opt
|
|
||||||
wget -qO "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
|
||||||
rm -rf /opt/opengist
|
|
||||||
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
|
||||||
chmod +x /opt/opengist/opengist
|
chmod +x /opt/opengist/opengist
|
||||||
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
rm -rf opengist*
|
||||||
rm -rf /opt/opengist${RELEASE}-linux-amd64.tar.gz
|
apt-get update &>/dev/null
|
||||||
apt-get -y autoremove &>/dev/null
|
apt-get -y upgrade &>/dev/null
|
||||||
apt-get -y autoclean &>/dev/null
|
msg_ok "Updated Successfully"
|
||||||
msg_ok "Updated ${APP} LXC"
|
exit
|
||||||
|
|
||||||
msg_info "Starting Service"
|
|
||||||
systemctl start opengist.service
|
|
||||||
msg_ok "Started Service"
|
|
||||||
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: Jonathan (jd-apprentice)
|
# Author: Jonathan (jd-apprentice)
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT
|
||||||
|
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
|
||||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
color
|
color
|
||||||
@ -13,26 +14,25 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y curl
|
||||||
mc \
|
$STD apt-get install -y jq
|
||||||
curl \
|
$STD apt-get install -y sudo
|
||||||
sudo
|
$STD apt-get install -y git
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Install Opengist"
|
msg_info "Download Opengist Binary"
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
LATEST_URL=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | jq -r '.assets[] | select(.name | contains("linux-amd64.tar.gz")).browser_download_url')
|
||||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
wget "$LATEST_URL"
|
||||||
wget -q "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
msg_ok "Downloaded Opengist Binary"
|
||||||
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
|
||||||
mv opengist /opt/opengist
|
msg_info "Creating Systemd Service"
|
||||||
|
mkdir -p /opt/opengist
|
||||||
|
mv opengist*.tar.gz opengist.tar.gz
|
||||||
|
tar -xf opengist.tar.gz
|
||||||
|
mv opengist/opengist /opt/opengist/opengist
|
||||||
|
mv opengist/config.yml /opt/opengist/config.yml
|
||||||
chmod +x /opt/opengist/opengist
|
chmod +x /opt/opengist/opengist
|
||||||
mkdir -p /opt/opengist-data
|
rm -rf opengist*
|
||||||
msg_ok "Installed Opengist"
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
|
||||||
|
|
||||||
sed -i 's|opengist-home:.*|opengist-home: /opt/opengist-data|' /opt/opengist/config.yml
|
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/opengist.service
|
cat <<EOF >/etc/systemd/system/opengist.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Opengist server to manage your Gists
|
Description=Opengist server to manage your Gists
|
||||||
@ -40,21 +40,24 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/opengist
|
WorkingDirectory=/opt/opengist
|
||||||
ExecStart=/opt/opengist/opengist --config config.yaml
|
ExecStart=/opt/opengist/opengist
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
msg_ok "Created Systemd Service"
|
||||||
|
|
||||||
|
msg_info "Starting Service"
|
||||||
|
systemctl daemon-reload
|
||||||
systemctl enable -q --now opengist.service
|
systemctl enable -q --now opengist.service
|
||||||
msg_ok "Created Service"
|
msg_ok "Started Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -rf /opengist${RELEASE}-linux-amd64.tar.gz
|
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
Loading…
Reference in New Issue
Block a user