Last active
February 18, 2025 13:25
-
-
Save CrazyWolf13/3ed46f8849923b73cbb0de0bba739123 to your computer and use it in GitHub Desktop.
Exportarr-online-install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p /opt/exportarr | |
cd /opt/ | |
RELEASE=$(curl -s https://api.github.com/repos/onedr0p/exportarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') | |
wget -q "https://github.com/onedr0p/exportarr/releases/download/v${RELEASE}/exportarr_${RELEASE}_linux_amd64.tar.gz" | |
tar -xzf exportarr_${RELEASE}_linux_amd64.tar.gz | |
rm exportarr_${RELEASE}_linux_amd64.tar.gz | |
mv exportarr_${RELEASE}_linux_amd64/* /opt/exportarr | |
rmdir exportarr_${RELEASE}_linux_amd64 | |
# Prompt for required information | |
read -p "Enter app name (radarr/sonarr/lidarr/etc): " APP_NAME | |
read -p "Enter app URL (e.g., http://127.0.0.1:7878): " APP_URL | |
read -p "Enter API key: " API_KEY | |
read -p "Enter auth username: " AUTH_USER | |
read -s -p "Enter auth password: " AUTH_PASS | |
echo | |
cat << EOF > /etc/systemd/system/exportarr.service | |
[Unit] | |
Description=Exportarr Prometheus Exporter | |
After=network-online.target | |
[Service] | |
Type=simple | |
ExecStart=/opt/exportarr/exportarr ${APP_NAME} \\ | |
--port 9797 \\ | |
--url "${APP_URL}" \\ | |
--api-key "${API_KEY}" \\ | |
--auth-password "${AUTH_PASS}" \\ | |
--auth-username "${AUTH_USER}" \\ | |
--form-auth true \\ | |
--enable-additional-metrics true | |
Restart=always | |
RestartSec=10 | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
echo "Service file created at /etc/systemd/system/exportarr.service" | |
systemctl enable --now exportarr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment