2024-05-09 12:01:00 -04: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 14:21:33 -04:00
APP = "Umami"
2024-05-09 12:11:23 -04:00
var_disk = "12"
var_cpu = "2"
2024-05-09 12:25:01 -04:00
var_ram = "2048"
2024-05-09 12:01:00 -04: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 05:16:23 -04:00
function update_script( ) {
header_info
if [ [ ! -d /opt/umami ] ] ; then msg_error " No ${ APP } Installation Found! " ; exit; fi
2024-10-20 22:13:27 -04:00
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "SET RESOURCES" " Please set the resources in your ${ APP } LXC to ${ var_cpu } vCPU and ${ var_ram } RAM for the build process before continuing " 10 75
2024-06-21 05:16:23 -04:00
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 12:01:00 -04:00
start
build_container
description
2024-05-09 12:25:01 -04: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 12:01:00 -04:00
msg_ok "Completed Successfully!\n"
echo -e " ${ APP } should be reachable by going to the following URL.
2024-05-09 12:11:23 -04:00
${ BL } http://${ IP } :3000${ CL } \n "