|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Copyright (c) 2021-2025 community-scripts ORG |
| 4 | +# Author: elvito |
| 5 | +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |
| 6 | +# Source: https://github.com/PCJones/UmlautAdaptarr |
| 7 | + |
| 8 | +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" |
| 9 | +color |
| 10 | +verb_ip6 |
| 11 | +catch_errors |
| 12 | +setting_up_container |
| 13 | +network_check |
| 14 | +update_os |
| 15 | + |
| 16 | +msg_info "Installing Dependencies" |
| 17 | +$STD curl -fsSL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -o packages-microsoft-prod.deb |
| 18 | +$STD dpkg -i packages-microsoft-prod.deb |
| 19 | +$STD apt-get update |
| 20 | +$STD apt-get install -y \ |
| 21 | + dotnet-sdk-8.0 \ |
| 22 | + aspnetcore-runtime-8.0 |
| 23 | +msg_ok "Installed Dependencies" |
| 24 | + |
| 25 | +msg_info "Installing Umlautadaptarr" |
| 26 | +temp_file=$(mktemp) |
| 27 | +RELEASE=$(curl -s https://api.github.com/repos/PCJones/Umlautadaptarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') |
| 28 | +curl -fsSL "https://github.com/PCJones/Umlautadaptarr/releases/download/${RELEASE}/linux-x64.zip" -o $temp_file |
| 29 | +unzip -qj $temp_file '*/**' -d /opt/UmlautAdaptarr |
| 30 | +echo "${RELEASE}" >"/opt/UmlautAdaptarr_version.txt" |
| 31 | +msg_ok "Installation completed" |
| 32 | + |
| 33 | +msg_info "Creating appsettings.json" |
| 34 | +cat <<EOF >/opt/UmlautAdaptarr/appsettings.json |
| 35 | +{ |
| 36 | + "Logging": { |
| 37 | + "LogLevel": { |
| 38 | + "Default": "Information", |
| 39 | + "Microsoft.AspNetCore": "Warning" |
| 40 | + }, |
| 41 | + "Console": { |
| 42 | + "TimestampFormat": "yyyy-MM-dd HH:mm:ss::" |
| 43 | + } |
| 44 | + }, |
| 45 | + "AllowedHosts": "*", |
| 46 | + "Kestrel": { |
| 47 | + "Endpoints": { |
| 48 | + "Http": { |
| 49 | + "Url": "http://[::]:5005" |
| 50 | + } |
| 51 | + } |
| 52 | + }, |
| 53 | + "Settings": { |
| 54 | + "UserAgent": "UmlautAdaptarr/1.0", |
| 55 | + "UmlautAdaptarrApiHost": "https://umlautadaptarr.pcjones.de/api/v1", |
| 56 | + "IndexerRequestsCacheDurationInMinutes": 12 |
| 57 | + }, |
| 58 | + "Sonarr": [ |
| 59 | + { |
| 60 | + "Enabled": false, |
| 61 | + "Name": "Sonarr", |
| 62 | + "Host": "http://192.168.1.100:8989", |
| 63 | + "ApiKey": "dein_sonarr_api_key" |
| 64 | + } |
| 65 | + ], |
| 66 | + "Radarr": [ |
| 67 | + { |
| 68 | + "Enabled": false, |
| 69 | + "Name": "Radarr", |
| 70 | + "Host": "http://192.168.1.101:7878", |
| 71 | + "ApiKey": "dein_radarr_api_key" |
| 72 | + } |
| 73 | + ], |
| 74 | + "Lidarr": [ |
| 75 | + { |
| 76 | + "Enabled": false, |
| 77 | + "Host": "http://192.168.1.102:8686", |
| 78 | + "ApiKey": "dein_lidarr_api_key" |
| 79 | + }, |
| 80 | + ], |
| 81 | + "Readarr": [ |
| 82 | + { |
| 83 | + "Enabled": false, |
| 84 | + "Host": "http://192.168.1.103:8787", |
| 85 | + "ApiKey": "dein_readarr_api_key" |
| 86 | + }, |
| 87 | + ], |
| 88 | + "IpLeakTest": { |
| 89 | + "Enabled": false |
| 90 | + } |
| 91 | +} |
| 92 | +EOF |
| 93 | +msg_ok "appsettings.json created" |
| 94 | + |
| 95 | +msg_info "Creating Service" |
| 96 | +cat <<EOF >/etc/systemd/system/umlautadaptarr.service |
| 97 | +[Unit] |
| 98 | +Description=UmlautAdaptarr Service |
| 99 | +After=network.target |
| 100 | +
|
| 101 | +[Service] |
| 102 | +WorkingDirectory=/opt/UmlautAdaptarr |
| 103 | +ExecStart=/usr/bin/dotnet /opt/UmlautAdaptarr/bin/Release/net8.0/UmlautAdaptarr.dll --urls=http://0.0.0.0:5005 |
| 104 | +Restart=always |
| 105 | +User=root |
| 106 | +Group=root |
| 107 | +Environment=ASPNETCORE_ENVIRONMENT=Production |
| 108 | +
|
| 109 | +[Install] |
| 110 | +WantedBy=multi-user.target |
| 111 | +EOF |
| 112 | +systemctl -q --now enable umlautadaptarr |
| 113 | +msg_ok "Created Service" |
| 114 | + |
| 115 | +motd_ssh |
| 116 | +customize |
| 117 | + |
| 118 | +msg_info "Cleaning up" |
| 119 | +rm -f $temp_file |
| 120 | +$STD apt-get -y autoremove |
| 121 | +$STD apt-get -y autoclean |
| 122 | +msg_ok "Cleaned" |
0 commit comments