mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	* Bump L to N-Scripts to Debian 13 (Trixie) * refactor * Add apt clean command to cleanup process * Add apt clean command to cleanup process --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
		
			
				
	
	
		
			70 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
# Copyright (c) 2021-2025 community-scripts ORG
 | 
						|
# Author: davalanche
 | 
						|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
 | 
						|
# Source: https://github.com/mylar3/mylar3
 | 
						|
 | 
						|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
 | 
						|
color
 | 
						|
verb_ip6
 | 
						|
catch_errors
 | 
						|
setting_up_container
 | 
						|
network_check
 | 
						|
update_os
 | 
						|
 | 
						|
msg_info "Installing Dependencies"
 | 
						|
$STD apt install -y jq
 | 
						|
cat <<EOF >/etc/apt/sources.list.d/non-free.sources
 | 
						|
Types: deb
 | 
						|
URIs: http://deb.debian.org/debian
 | 
						|
Suites: bookworm
 | 
						|
Components: non-free non-free-firmware
 | 
						|
EOF
 | 
						|
$STD apt update
 | 
						|
$STD apt install -y unrar
 | 
						|
rm /etc/apt/sources.list.d/non-free.sources
 | 
						|
msg_ok "Installed Dependencies"
 | 
						|
 | 
						|
msg_info "Setup Python3"
 | 
						|
$STD apt install -y python3-pip
 | 
						|
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
 | 
						|
$STD pip install -U --no-cache-dir pip
 | 
						|
msg_ok "Setup Python3"
 | 
						|
 | 
						|
msg_info "Installing ${APPLICATION}"
 | 
						|
mkdir -p /opt/mylar3
 | 
						|
mkdir -p /opt/mylar3-data
 | 
						|
RELEASE=$(curl -fsSL https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name')
 | 
						|
curl -fsSL "https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz --strip-components=1 -C /opt/mylar3
 | 
						|
$STD pip install --no-cache-dir -r /opt/mylar3/requirements.txt
 | 
						|
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
 | 
						|
msg_ok "Installed ${APPLICATION}"
 | 
						|
 | 
						|
msg_info "Creating Service"
 | 
						|
cat <<EOF >/etc/systemd/system/mylar3.service
 | 
						|
[Unit]
 | 
						|
Description=Mylar3 Service
 | 
						|
After=network-online.target
 | 
						|
 | 
						|
[Service]
 | 
						|
ExecStart=/usr/bin/python3 /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data
 | 
						|
GuessMainPID=no
 | 
						|
Type=forking
 | 
						|
Restart=on-failure
 | 
						|
 | 
						|
[Install]
 | 
						|
WantedBy=multi-user.target
 | 
						|
EOF
 | 
						|
systemctl enable -q --now mylar3
 | 
						|
msg_ok "Created Service"
 | 
						|
 | 
						|
motd_ssh
 | 
						|
customize
 | 
						|
 | 
						|
msg_info "Cleaning up"
 | 
						|
$STD apt -y autoremove
 | 
						|
$STD apt -y autoclean
 | 
						|
$STD apt -y clean
 | 
						|
msg_ok "Cleaned"
 |