2024-05-09 18:01:00 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
|
|
|
|
# Copyright (c) 2021-2024 tteck
|
|
|
|
# Author: tteck (tteckster)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
|
|
|
|
|
|
function header_info {
|
|
|
|
clear
|
|
|
|
cat <<"EOF"
|
|
|
|
_
|
|
|
|
__ ______ ___ ____ _____ ___ (_)
|
|
|
|
/ / / / __ `__ \/ __ `/ __ `__ \/ /
|
|
|
|
/ /_/ / / / / / / /_/ / / / / / / /
|
|
|
|
\__,_/_/ /_/ /_/\__,_/_/ /_/ /_/_/
|
|
|
|
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
header_info
|
|
|
|
echo -e "Loading..."
|
2024-05-10 20:21:33 +02:00
|
|
|
APP="Umami"
|
2024-05-09 18:11:23 +02:00
|
|
|
var_disk="12"
|
|
|
|
var_cpu="2"
|
2024-05-09 18:25:01 +02:00
|
|
|
var_ram="2048"
|
2024-05-09 18:01:00 +02:00
|
|
|
var_os="debian"
|
|
|
|
var_version="12"
|
|
|
|
variables
|
|
|
|
color
|
|
|
|
catch_errors
|
|
|
|
|
|
|
|
function default_settings() {
|
|
|
|
CT_TYPE="1"
|
|
|
|
PW=""
|
|
|
|
CT_ID=$NEXTID
|
|
|
|
HN=$NSAPP
|
|
|
|
DISK_SIZE="$var_disk"
|
|
|
|
CORE_COUNT="$var_cpu"
|
|
|
|
RAM_SIZE="$var_ram"
|
|
|
|
BRG="vmbr0"
|
|
|
|
NET="dhcp"
|
|
|
|
GATE=""
|
|
|
|
APT_CACHER=""
|
|
|
|
APT_CACHER_IP=""
|
|
|
|
DISABLEIP6="no"
|
|
|
|
MTU=""
|
|
|
|
SD=""
|
|
|
|
NS=""
|
|
|
|
MAC=""
|
|
|
|
VLAN=""
|
|
|
|
SSH="no"
|
|
|
|
VERB="no"
|
|
|
|
echo_default
|
|
|
|
}
|
|
|
|
|
2024-06-21 11:16:23 +02:00
|
|
|
function update_script() {
|
|
|
|
header_info
|
|
|
|
if [[ ! -d /opt/umami ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
|
|
|
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
|
|
|
|
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
|
|
|
|
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
msg_info "Stopping ${APP}"
|
|
|
|
systemctl stop umami
|
|
|
|
msg_ok "Stopped $APP"
|
|
|
|
|
|
|
|
msg_info "Updating ${APP}"
|
|
|
|
cd /opt/umami
|
|
|
|
git pull
|
|
|
|
yarn install
|
|
|
|
yarn build
|
|
|
|
msg_ok "Updated ${APP}"
|
|
|
|
|
|
|
|
msg_info "Starting ${APP}"
|
|
|
|
systemctl start umami
|
|
|
|
msg_ok "Started ${APP}"
|
|
|
|
|
|
|
|
msg_ok "Updated Successfully"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2024-05-09 18:01:00 +02:00
|
|
|
start
|
|
|
|
build_container
|
|
|
|
description
|
|
|
|
|
2024-05-09 18:25:01 +02:00
|
|
|
msg_info "Setting Container to Normal Resources"
|
|
|
|
pct set $CTID -memory 1024
|
|
|
|
pct set $CTID -cores 1
|
|
|
|
msg_ok "Set Container to Normal Resources"
|
2024-05-09 18:01:00 +02:00
|
|
|
msg_ok "Completed Successfully!\n"
|
|
|
|
echo -e "${APP} should be reachable by going to the following URL.
|
2024-05-09 18:11:23 +02:00
|
|
|
${BL}http://${IP}:3000${CL} \n"
|