kavita-install.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 Kavita"
  19. cd /opt
  20. RELEASE=$(curl -s https://api.github.com/repos/Kareadita/Kavita/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
  21. $STD tar -xvzf <(curl -fsSL https://github.com/Kareadita/Kavita/releases/download/$RELEASE/kavita-linux-x64.tar.gz) --no-same-owner
  22. msg_ok "Installed Kavita"
  23. msg_info "Creating Service"
  24. service_path="/etc/systemd/system/kavita.service"
  25. echo "[Unit]
  26. Description=Kavita Server
  27. After=network.target
  28. [Service]
  29. Type=simple
  30. WorkingDirectory=/opt/Kavita
  31. ExecStart=/opt/Kavita/Kavita
  32. TimeoutStopSec=20
  33. KillMode=process
  34. Restart=on-failure
  35. [Install]
  36. WantedBy=multi-user.target" >$service_path
  37. chmod +x /opt/Kavita/* && chown root /opt/Kavita/*
  38. systemctl enable --now -q kavita.service
  39. msg_ok "Created Service"
  40. motd_ssh
  41. customize
  42. msg_info "Cleaning up"
  43. $STD apt-get autoremove
  44. $STD apt-get autoclean
  45. msg_ok "Cleaned"