mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-26 02:05:54 +00:00
Added install script for Scraparr - a Prometheus exporter for *arr applications.
This commit is contained in:
68
install/scraparr-install.sh
Normal file
68
install/scraparr-install.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: JasonGreenC
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/thecfu/scraparr
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
python3-pip
|
||||
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing Scraparr"
|
||||
temp_file=$(mktemp)
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/thecfu/scraparr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
echo "${RELEASE}" >"/opt/Scraparr_version.txt"
|
||||
curl -fsSL "https://github.com/thecfu/scraparr/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
|
||||
tar -zxf "$temp_file"
|
||||
mv "scraparr-${RELEASE}" /opt/scraparr
|
||||
pip -q install -r /opt/scraparr/src/scraparr/requirements.txt --root-user-action=ignore
|
||||
chmod -R 755 /opt/scraparr
|
||||
mkdir /scraparr && mkdir /scraparr/config
|
||||
mv /opt/scraparr/config.yaml /scraparr/config/config.yaml
|
||||
chmod -R 755 /scraparr
|
||||
msg_ok "Installed Scraparr"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/scraparr.service
|
||||
[Unit]
|
||||
Description=Scraparr
|
||||
Wants=network-online.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 -m scraparr.scraparr
|
||||
WorkingDirectory=/opt/scraparr/src
|
||||
User=root
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now scraparr
|
||||
|
||||
msg_ok "Configured Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f "$temp_file"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
Reference in New Issue
Block a user