parent
327544c737
commit
e208b571b9
14
ct/mylar3.sh
14
ct/mylar3.sh
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: davalanche
|
# Author: davalanche | Co-Author: Slaviša Arežina (tremor021)
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://github.com/mylar3/mylar3
|
# Source: https://github.com/mylar3/mylar3
|
||||||
|
|
||||||
@ -25,16 +25,10 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name')
|
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
if check_for_gh_release "mylar3" "mylar3/mylar3"; then
|
||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
fetch_and_deploy_gh_release "mylar3" "mylar3/mylar3" "tarball"
|
||||||
rm -rf /opt/mylar3/* /opt/mylar3/.*
|
|
||||||
curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3
|
|
||||||
systemctl restart mylar3
|
systemctl restart mylar3
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: davalanche
|
# Author: davalanche | Co-Author: Slaviša Arežina (tremor021)
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://github.com/mylar3/mylar3
|
# Source: https://github.com/mylar3/mylar3
|
||||||
|
|
||||||
@ -14,7 +14,6 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y jq
|
|
||||||
cat <<EOF >/etc/apt/sources.list.d/non-free.sources
|
cat <<EOF >/etc/apt/sources.list.d/non-free.sources
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: http://deb.debian.org/debian
|
URIs: http://deb.debian.org/debian
|
||||||
@ -23,22 +22,17 @@ Components: non-free non-free-firmware
|
|||||||
EOF
|
EOF
|
||||||
$STD apt update
|
$STD apt update
|
||||||
$STD apt install -y unrar
|
$STD apt install -y unrar
|
||||||
rm /etc/apt/sources.list.d/non-free.sources
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setup Python3"
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
$STD apt install -y python3-pip
|
fetch_and_deploy_gh_release "mylar3" "mylar3/mylar3" "tarball"
|
||||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
|
||||||
$STD pip install -U --no-cache-dir pip
|
|
||||||
msg_ok "Setup Python3"
|
|
||||||
|
|
||||||
msg_info "Installing ${APPLICATION}"
|
msg_info "Installing ${APPLICATION}"
|
||||||
mkdir -p /opt/mylar3
|
|
||||||
mkdir -p /opt/mylar3-data
|
mkdir -p /opt/mylar3-data
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name')
|
$STD uv venv /opt/mylar3/.venv
|
||||||
curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3
|
$STD /opt/mylar3/.venv/bin/python -m ensurepip --upgrade
|
||||||
$STD pip install --no-cache-dir -r /opt/mylar3/requirements.txt
|
$STD /opt/mylar3/.venv/bin/python -m pip install --upgrade pip
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
$STD /opt/mylar3/.venv/bin/python -m pip install --no-cache-dir -r /opt/mylar3/requirements.txt
|
||||||
msg_ok "Installed ${APPLICATION}"
|
msg_ok "Installed ${APPLICATION}"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
@ -48,7 +42,7 @@ Description=Mylar3 Service
|
|||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/python3 /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data
|
ExecStart=/opt/mylar3/.venv/bin/python /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data
|
||||||
GuessMainPID=no
|
GuessMainPID=no
|
||||||
Type=forking
|
Type=forking
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user