autobrr-install.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. msg_ok "Installed Dependencies"
  18. msg_info "Installing Autobrr"
  19. wget -q $(curl -s https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)
  20. tar -C /usr/local/bin -xzf autobrr*.tar.gz
  21. rm -rf autobrr*.tar.gz
  22. mkdir -p /root/.config/autobrr
  23. cat <<EOF >>/root/.config/autobrr/config.toml
  24. # https://autobrr.com/configuration/autobrr
  25. host = "0.0.0.0"
  26. port = 7474
  27. logLevel = "DEBUG"
  28. sessionSecret = "$(openssl rand -base64 24)"
  29. EOF
  30. msg_ok "Installed Autobrr"
  31. msg_info "Creating Service"
  32. service_path="/etc/systemd/system/autobrr.service"
  33. echo "[Unit]
  34. Description=autobrr service
  35. After=syslog.target network-online.target
  36. [Service]
  37. Type=simple
  38. User=root
  39. Group=root
  40. ExecStart=/usr/local/bin/autobrr --config=/root/.config/autobrr/
  41. [Install]
  42. WantedBy=multi-user.target" >$service_path
  43. systemctl enable --now -q autobrr.service
  44. msg_ok "Created Service"
  45. motd_ssh
  46. root
  47. msg_info "Cleaning up"
  48. $STD apt-get autoremove
  49. $STD apt-get autoclean
  50. msg_ok "Cleaned"