uptimekuma.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/usr/bin/env bash
  2. source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
  3. # Copyright (c) 2021-2023 tteck
  4. # Author: tteck (tteckster)
  5. # License: MIT
  6. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  7. function header_info {
  8. clear
  9. cat <<"EOF"
  10. __ __ __ _ __ __
  11. / / / /___ / /_(_)___ ___ ___ / //_/_ ______ ___ ____ _
  12. / / / / __ \/ __/ / __ __ \/ _ \ / ,< / / / / __ __ \/ __ /
  13. / /_/ / /_/ / /_/ / / / / / / __/ / /| / /_/ / / / / / / /_/ /
  14. \____/ .___/\__/_/_/ /_/ /_/\___/ /_/ |_\__,_/_/ /_/ /_/\__,_/
  15. /_/
  16. EOF
  17. }
  18. header_info
  19. echo -e "Loading..."
  20. APP="Uptime Kuma"
  21. var_disk="4"
  22. var_cpu="1"
  23. var_ram="1024"
  24. var_os="debian"
  25. var_version="12"
  26. variables
  27. color
  28. catch_errors
  29. function default_settings() {
  30. CT_TYPE="1"
  31. PW=""
  32. CT_ID=$NEXTID
  33. HN=$NSAPP
  34. DISK_SIZE="$var_disk"
  35. CORE_COUNT="$var_cpu"
  36. RAM_SIZE="$var_ram"
  37. BRG="vmbr0"
  38. NET="dhcp"
  39. GATE=""
  40. DISABLEIP6="no"
  41. MTU=""
  42. SD=""
  43. NS=""
  44. MAC=""
  45. VLAN=""
  46. SSH="no"
  47. VERB="no"
  48. echo_default
  49. }
  50. function update_script() {
  51. header_info
  52. if [[ ! -d /opt/uptime-kuma ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
  53. LATEST=$(curl -sL https://api.github.com/repos/louislam/uptime-kuma/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
  54. msg_info "Stopping ${APP}"
  55. sudo systemctl stop uptime-kuma &>/dev/null
  56. msg_ok "Stopped ${APP}"
  57. cd /opt/uptime-kuma
  58. msg_info "Pulling ${APP} ${LATEST}"
  59. git fetch --all &>/dev/null
  60. git checkout $LATEST --force &>/dev/null
  61. msg_ok "Pulled ${APP} ${LATEST}"
  62. msg_info "Updating ${APP} to ${LATEST}"
  63. npm install --production &>/dev/null
  64. npm run download-dist &>/dev/null
  65. msg_ok "Updated ${APP}"
  66. msg_info "Starting ${APP}"
  67. sudo systemctl start uptime-kuma &>/dev/null
  68. msg_ok "Started ${APP}"
  69. msg_ok "Updated Successfully"
  70. exit
  71. }
  72. start
  73. build_container
  74. description
  75. msg_ok "Completed Successfully!\n"
  76. echo -e "${APP} should be reachable by going to the following URL.
  77. ${BL}http://${IP}:3001${CL} \n"