homer-install.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. $STD apt-get install -y pip
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing Homer"
  20. mkdir -p /opt/homer
  21. cd /opt/homer
  22. wget -q https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip
  23. $STD unzip homer.zip
  24. rm -rf homer.zip
  25. cp assets/config.yml.dist assets/config.yml
  26. msg_ok "Installed Homer"
  27. msg_info "Creating Service"
  28. cat <<EOF >/etc/systemd/system/homer.service
  29. [Unit]
  30. Description=Homer Dashboard
  31. After=network-online.target
  32. [Service]
  33. Type=simple
  34. WorkingDirectory=/opt/homer
  35. ExecStart=python3 -m http.server 8010
  36. [Install]
  37. WantedBy=multi-user.target
  38. EOF
  39. $STD systemctl enable --now homer
  40. msg_ok "Created Service"
  41. motd_ssh
  42. customize
  43. msg_info "Cleaning up"
  44. $STD apt-get autoremove
  45. $STD apt-get autoclean
  46. msg_ok "Cleaned"