heimdalldashboard-install.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 PHP"
  19. $STD apt-get install -y php
  20. $STD apt-get install -y php-sqlite3
  21. $STD apt-get install -y php-zip
  22. $STD apt-get install -y php-xml
  23. msg_ok "Installed PHP"
  24. RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]')
  25. msg_info "Installing Heimdall Dashboard ${RELEASE}"
  26. $STD curl --silent -o ${RELEASE}.tar.gz -L "https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz"
  27. $STD tar xvzf ${RELEASE}.tar.gz
  28. VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest |
  29. grep "tag_name" |
  30. awk '{print substr($2, 3, length($2)-4) }')
  31. rm -rf ${RELEASE}.tar.gz
  32. mv Heimdall-${VER} /opt/Heimdall
  33. msg_ok "Installed Heimdall Dashboard ${RELEASE}"
  34. msg_info "Creating Service"
  35. service_path="/etc/systemd/system/heimdall.service"
  36. echo "[Unit]
  37. Description=Heimdall
  38. After=network.target
  39. [Service]
  40. Restart=always
  41. RestartSec=5
  42. Type=simple
  43. User=root
  44. WorkingDirectory=/opt/Heimdall
  45. ExecStart="/usr/bin/php" artisan serve --port 7990 --host 0.0.0.0
  46. TimeoutStopSec=30
  47. [Install]
  48. WantedBy=multi-user.target" >$service_path
  49. $STD sudo systemctl enable --now heimdall.service
  50. msg_ok "Created Service"
  51. motd_ssh
  52. customize
  53. msg_info "Cleaning up"
  54. $STD apt-get autoremove
  55. $STD apt-get autoclean
  56. msg_ok "Cleaned"