cleanup
This commit is contained in:
parent
df2ee20e60
commit
063633d82f
@ -8,6 +8,10 @@
|
|||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/core.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/core.func)
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/tools.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/tools.func)
|
||||||
|
|
||||||
|
# Enable error handling
|
||||||
|
set -Eeuo pipefail
|
||||||
|
trap 'error_handler' ERR
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
@ -17,6 +21,9 @@ INSTALL_PATH="/opt/jellystat"
|
|||||||
CONFIG_PATH="/opt/jellystat/.env"
|
CONFIG_PATH="/opt/jellystat/.env"
|
||||||
DEFAULT_PORT=3000
|
DEFAULT_PORT=3000
|
||||||
|
|
||||||
|
# Initialize STD mode from core.func
|
||||||
|
set_std_mode
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# HEADER
|
# HEADER
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
@ -33,30 +40,10 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# COLORS & FORMATTING
|
# HELPER FUNCTIONS
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
YW=$(echo "\033[33m")
|
get_ip() {
|
||||||
GN=$(echo "\033[1;92m")
|
hostname -I 2>/dev/null | awk '{print $1}' || echo "127.0.0.1"
|
||||||
RD=$(echo "\033[01;31m")
|
|
||||||
BL=$(echo "\033[36m")
|
|
||||||
CL=$(echo "\033[m")
|
|
||||||
CM="${GN}✔️${CL}"
|
|
||||||
CROSS="${RD}✖️${CL}"
|
|
||||||
INFO="${BL}ℹ️${CL}"
|
|
||||||
TAB=" "
|
|
||||||
|
|
||||||
function msg_info() { echo -e "${INFO} ${YW}${1}...${CL}"; }
|
|
||||||
function msg_ok() { echo -e "${CM} ${GN}${1}${CL}"; }
|
|
||||||
function msg_error() { echo -e "${CROSS} ${RD}${1}${CL}"; }
|
|
||||||
function msg_warn() { echo -e "⚠️ ${YW}${1}${CL}"; }
|
|
||||||
|
|
||||||
function get_ip() {
|
|
||||||
local iface ip
|
|
||||||
iface=$(ip -4 route | awk '/default/ {print $5; exit}')
|
|
||||||
ip=$(ip -4 addr show "$iface" 2>/dev/null | awk '/inet / {print $2}' | cut -d/ -f1 | head -n1)
|
|
||||||
[[ -z "$ip" ]] && ip=$(hostname -I 2>/dev/null | awk '{print $1}')
|
|
||||||
[[ -z "$ip" ]] && ip="127.0.0.1"
|
|
||||||
echo "$ip"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user