olivetin.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. function header_info {
  7. clear
  8. cat <<"EOF"
  9. ____ ___ _______
  10. / __ \/ (_) _____/_ __(_)___
  11. / / / / / / | / / _ \/ / / / __ \
  12. / /_/ / / /| |/ / __/ / / / / / /
  13. \____/_/_/ |___/\___/_/ /_/_/ /_/
  14. EOF
  15. }
  16. IP=$(hostname -I | awk '{print $1}')
  17. YW=$(echo "\033[33m")
  18. BL=$(echo "\033[36m")
  19. GN=$(echo "\033[1;92m")
  20. CL=$(echo "\033[m")
  21. BFR="\\r\\033[K"
  22. HOLD="-"
  23. CM="${GN}✓${CL}"
  24. APP="OliveTin"
  25. hostname="$(hostname)"
  26. set-e
  27. header_info
  28. while true; do
  29. read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
  30. case $yn in
  31. [Yy]*) break ;;
  32. [Nn]*) exit ;;
  33. *) echo "Please answer yes or no." ;;
  34. esac
  35. done
  36. header_info
  37. function msg_info() {
  38. local msg="$1"
  39. echo -ne " ${HOLD} ${YW}${msg}..."
  40. }
  41. function msg_ok() {
  42. local msg="$1"
  43. echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
  44. }
  45. msg_info "Installing ${APP}"
  46. wget -q https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.deb
  47. dpkg -i OliveTin_linux_amd64.deb &>/dev/null
  48. systemctl enable --now OliveTin &>/dev/null
  49. rm OliveTin_linux_amd64.deb
  50. msg_ok "Installed ${APP} on $hostname"
  51. msg_ok "Completed Successfully!\n"
  52. echo -e "${APP} should be reachable by going to the following URL.
  53. ${BL}http://$IP:1337${CL} \n"