Compare commits

...

4 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
96991c347a tools: add data init and auto-reporting to tools and pve section
Introduce telemetry helpers in misc/api.func: _telemetry_report_exit (reports success/failure via post_tool_to_api/post_addon_to_api) and init_tool_telemetry (reads DIAGNOSTICS, starts install timer and installs an EXIT trap to auto-report). Integrate telemetry into many tools/addon and tools/pve scripts by sourcing the remote api.func and calling init_tool_telemetry (guarded with declare -f). Also apply a minor arithmetic formatting tweak in misc/build.func for RECOVERY_ATTEMPT.
2026-02-17 14:10:01 +01:00
CanbiZ (MickLesk)
8864e9aa9d Merge main - resolve conflict in build.func (keep improved ERR trap with exit_code check, add SIGHUP trap) 2026-02-17 12:20:43 +01:00
CanbiZ (MickLesk)
16a0329af3 Safer tools.func load and improved error handling
Replace process-substitution sourcing of tools.func with an explicit curl -> variable -> source via /dev/stdin, adding failure messages and a check that expected functions (e.g. fetch_and_deploy_gh_release) are present (misc/alpine-install.func, misc/install.func). Add categorize_error mapping for exit code 10 -> "config" (misc/api.func). Tweak build.func: minor pipeline formatting and change the ERR trap to capture the actual exit code and only call ensure_log_on_host/post_update on non-zero exits, preventing erroneous failure reporting.
2026-02-17 09:50:49 +01:00
CanbiZ (MickLesk)
50effb6d86 core: add progress; fix exit status
Introduce post_progress_to_api() in alpine-install.func and install.func to send a lightweight, fire-and-forget telemetry ping (HTTP POST) that updates an existing telemetry record to "configuring" when DIAGNOSTICS=yes and RANDOM_UUID is set. The function is non-blocking (curl -m 5, errors ignored) and is invoked during container setup and after OS updates to signal active progress. Also adjust api_exit_script() in build.func to report success (post_update_to_api "done" "0") for cases where the script exited normally but a completion status wasn't posted, instead of reporting failure.
2026-02-17 09:02:05 +01:00
53 changed files with 656 additions and 340 deletions

View File

@@ -14,6 +14,25 @@ catch_errors
# Get LXC IP address (must be called INSIDE container, after network is up) # Get LXC IP address (must be called INSIDE container, after network is up)
get_lxc_ip get_lxc_ip
# ------------------------------------------------------------------------------
# post_progress_to_api()
#
# - Lightweight progress ping from inside the container
# - Updates the existing telemetry record status from "installing" to "configuring"
# - Signals that the installation is actively progressing (not stuck)
# - Fire-and-forget: never blocks or fails the script
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
# ------------------------------------------------------------------------------
post_progress_to_api() {
command -v curl &>/dev/null || return 0
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
[[ -z "${RANDOM_UUID:-}" ]] && return 0
curl -fsS -m 5 -X POST "https://telemetry.community-scripts.org/telemetry" \
-H "Content-Type: application/json" \
-d "{\"random_id\":\"${RANDOM_UUID}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"configuring\"}" &>/dev/null || true
}
# This function enables IPv6 if it's not disabled and sets verbose mode # This function enables IPv6 if it's not disabled and sets verbose mode
verb_ip6() { verb_ip6() {
set_std_mode # Set STD mode based on VERBOSE set_std_mode # Set STD mode based on VERBOSE
@@ -53,6 +72,7 @@ setting_up_container() {
fi fi
msg_ok "Set up Container OS" msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(ip addr show | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | tail -n1)${CL}" msg_ok "Network Connected: ${BL}$(ip addr show | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | tail -n1)${CL}"
post_progress_to_api
} }
# This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected # This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected
@@ -85,8 +105,18 @@ network_check() {
update_os() { update_os() {
msg_info "Updating Container OS" msg_info "Updating Container OS"
$STD apk -U upgrade $STD apk -U upgrade
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) local tools_content
tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || {
msg_error "Failed to download tools.func"
exit 6
}
source /dev/stdin <<<"$tools_content"
if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then
msg_error "tools.func loaded but incomplete — missing expected functions"
exit 6
fi
msg_ok "Updated Container OS" msg_ok "Updated Container OS"
post_progress_to_api
} }
# This function modifies the message of the day (motd) and SSH settings # This function modifies the message of the day (motd) and SSH settings

View File

@@ -908,6 +908,9 @@ categorize_error() {
# Network errors (curl/wget) # Network errors (curl/wget)
6 | 7 | 22 | 35) echo "network" ;; 6 | 7 | 22 | 35) echo "network" ;;
# Docker / Privileged mode required
10) echo "config" ;;
# Timeout errors # Timeout errors
28 | 124 | 211) echo "timeout" ;; 28 | 124 | 211) echo "timeout" ;;
@@ -982,6 +985,62 @@ get_install_duration() {
echo $((now - INSTALL_START_TIME)) echo $((now - INSTALL_START_TIME))
} }
# ------------------------------------------------------------------------------
# _telemetry_report_exit()
#
# - Internal handler called by EXIT trap set in init_tool_telemetry()
# - Determines success/failure from exit code and reports via appropriate API
# - Arguments:
# * $1: exit_code from the script
# ------------------------------------------------------------------------------
_telemetry_report_exit() {
local ec="${1:-0}"
local status="success"
[[ "$ec" -ne 0 ]] && status="failed"
# Lazy name resolution: use explicit name, fall back to $APP, then "unknown"
local name="${TELEMETRY_TOOL_NAME:-${APP:-unknown}}"
if [[ "${TELEMETRY_TOOL_TYPE:-tool}" == "addon" ]]; then
post_addon_to_api "$name" "$status" "$ec"
else
post_tool_to_api "$name" "$status" "$ec"
fi
}
# ------------------------------------------------------------------------------
# init_tool_telemetry()
#
# - One-line telemetry setup for tools/addon scripts
# - Reads DIAGNOSTICS from /usr/local/community-scripts/diagnostics
# - Starts install timer for duration tracking
# - Sets EXIT trap to automatically report success/failure on script exit
# - Arguments:
# * $1: tool_name (optional, falls back to $APP at exit time)
# * $2: type ("tool" for PVE host scripts, "addon" for container addons)
# - Usage:
# source <(curl -fsSL .../misc/api.func) 2>/dev/null || true
# init_tool_telemetry "post-pve-install" "tool"
# init_tool_telemetry "" "addon" # uses $APP at exit time
# ------------------------------------------------------------------------------
init_tool_telemetry() {
local name="${1:-}"
local type="${2:-tool}"
[[ -n "$name" ]] && TELEMETRY_TOOL_NAME="$name"
TELEMETRY_TOOL_TYPE="$type"
# Read diagnostics opt-in/opt-out
if [[ -f /usr/local/community-scripts/diagnostics ]]; then
DIAGNOSTICS=$(grep -i "^DIAGNOSTICS=" /usr/local/community-scripts/diagnostics 2>/dev/null | awk -F'=' '{print $2}') || true
fi
start_install_timer
# EXIT trap: automatically report telemetry when script ends
trap '_telemetry_report_exit "$?"' EXIT
}
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# post_tool_to_api() # post_tool_to_api()
# #

View File

@@ -4431,7 +4431,7 @@ EOF'
export var_cpu="$CORE_COUNT" export var_cpu="$CORE_COUNT"
export VERBOSE="yes" export VERBOSE="yes"
export var_verbose="yes" export var_verbose="yes"
export RECOVERY_ATTEMPT=$(( ${RECOVERY_ATTEMPT:-0} + 1 )) export RECOVERY_ATTEMPT=$((${RECOVERY_ATTEMPT:-0} + 1))
echo -e "${YW}Rebuilding with increased resources (attempt ${RECOVERY_ATTEMPT}/2):${CL}" echo -e "${YW}Rebuilding with increased resources (attempt ${RECOVERY_ATTEMPT}/2):${CL}"
echo -e " Container ID: ${old_ctid}${CTID}" echo -e " Container ID: ${old_ctid}${CTID}"
@@ -5564,15 +5564,15 @@ api_exit_script() {
post_update_to_api "failed" "$exit_code" post_update_to_api "failed" "$exit_code"
elif [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then elif [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
# Script exited with 0 but never sent a completion status # Script exited with 0 but never sent a completion status
# This catches edge cases like early returns after post_to_api() # exit_code=0 is never an error — report as success
post_update_to_api "failed" "1" post_update_to_api "done" "0"
fi fi
} }
if command -v pveversion >/dev/null 2>&1; then if command -v pveversion >/dev/null 2>&1; then
trap 'api_exit_script' EXIT trap 'api_exit_script' EXIT
fi fi
trap '_ERR_CODE=$?; ensure_log_on_host; post_update_to_api "failed" "$_ERR_CODE"' ERR trap 'local _ec=$?; if [[ $_ec -ne 0 ]]; then ensure_log_on_host; post_update_to_api "failed" "$_ec"; fi' ERR
trap 'ensure_log_on_host; post_update_to_api "failed" "129"; exit 129' SIGHUP trap 'ensure_log_on_host; post_update_to_api "failed" "129"; exit 129' SIGHUP
trap 'ensure_log_on_host; post_update_to_api "failed" "130"; exit 130' SIGINT trap 'ensure_log_on_host; post_update_to_api "failed" "130"; exit 130' SIGINT
trap 'ensure_log_on_host; post_update_to_api "failed" "143"; exit 143' SIGTERM trap 'ensure_log_on_host; post_update_to_api "failed" "143"; exit 143' SIGTERM

View File

@@ -40,6 +40,25 @@ catch_errors
# Get LXC IP address (must be called INSIDE container, after network is up) # Get LXC IP address (must be called INSIDE container, after network is up)
get_lxc_ip get_lxc_ip
# ------------------------------------------------------------------------------
# post_progress_to_api()
#
# - Lightweight progress ping from inside the container
# - Updates the existing telemetry record status from "installing" to "configuring"
# - Signals that the installation is actively progressing (not stuck)
# - Fire-and-forget: never blocks or fails the script
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
# ------------------------------------------------------------------------------
post_progress_to_api() {
command -v curl &>/dev/null || return 0
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
[[ -z "${RANDOM_UUID:-}" ]] && return 0
curl -fsS -m 5 -X POST "https://telemetry.community-scripts.org/telemetry" \
-H "Content-Type: application/json" \
-d "{\"random_id\":\"${RANDOM_UUID}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"configuring\"}" &>/dev/null || true
}
# ============================================================================== # ==============================================================================
# SECTION 2: NETWORK & CONNECTIVITY # SECTION 2: NETWORK & CONNECTIVITY
# ============================================================================== # ==============================================================================
@@ -103,6 +122,7 @@ setting_up_container() {
msg_ok "Set up Container OS" msg_ok "Set up Container OS"
#msg_custom "${CM}" "${GN}" "Network Connected: ${BL}$(hostname -I)" #msg_custom "${CM}" "${GN}" "Network Connected: ${BL}$(hostname -I)"
msg_ok "Network Connected: ${BL}$(hostname -I)" msg_ok "Network Connected: ${BL}$(hostname -I)"
post_progress_to_api
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -206,8 +226,18 @@ EOF
$STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Updated Container OS" msg_ok "Updated Container OS"
post_progress_to_api
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) local tools_content
tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || {
msg_error "Failed to download tools.func"
exit 6
}
source /dev/stdin <<<"$tools_content"
if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then
msg_error "tools.func loaded but incomplete — missing expected functions"
exit 6
fi
} }
# ============================================================================== # ==============================================================================

View File

@@ -19,6 +19,11 @@ EOF
} }
header_info header_info
set -e set -e
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-netbird-lxc" "tool"
while true; do while true; do
read -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)?" yn read -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)?" yn
case $yn in case $yn in

View File

@@ -23,6 +23,10 @@ function msg_info() { echo -e " \e[1;36m➤\e[0m $1"; }
function msg_ok() { echo -e " \e[1;32m✔\e[0m $1"; } function msg_ok() { echo -e " \e[1;32m✔\e[0m $1"; }
function msg_error() { echo -e " \e[1;31m✖\e[0m $1"; } function msg_error() { echo -e " \e[1;31m✖\e[0m $1"; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-tailscale-lxc" "tool"
header_info header_info
if ! command -v pveversion &>/dev/null; then if ! command -v pveversion &>/dev/null; then

View File

@@ -13,6 +13,7 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
@@ -29,6 +30,7 @@ DEFAULT_PORT=8080
# Initialize all core functions (colors, formatting, icons, STD mode) # Initialize all core functions (colors, formatting, icons, STD mode)
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# HEADER # HEADER

View File

@@ -42,6 +42,11 @@ function msg() {
local TEXT="$1" local TEXT="$1"
echo -e "$TEXT" echo -e "$TEXT"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "all-templates" "tool"
function validate_container_id() { function validate_container_id() {
local ctid="$1" local ctid="$1"
# Check if ID is numeric # Check if ID is numeric

View File

@@ -28,6 +28,11 @@ HOLD="-"
CM="${GN}${CL}" CM="${GN}${CL}"
APP="Coder Code Server" APP="Coder Code Server"
hostname="$(hostname)" hostname="$(hostname)"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "coder-code-server" "addon"
set -o errexit set -o errexit
set -o errtrace set -o errtrace
set -o nounset set -o nounset

View File

@@ -13,11 +13,13 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# CONFIGURATION # CONFIGURATION

View File

@@ -17,6 +17,11 @@ HOLD="-"
CM="${GN}${CL}" CM="${GN}${CL}"
APP="CrowdSec" APP="CrowdSec"
hostname="$(hostname)" hostname="$(hostname)"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "crowdsec" "addon"
set -o errexit set -o errexit
set -o errtrace set -o errtrace
set -o nounset set -o nounset

View File

@@ -32,6 +32,10 @@ DEFAULT_PORT=8080
SRC_DIR="/" SRC_DIR="/"
TMP_BIN="/tmp/filebrowser.$$" TMP_BIN="/tmp/filebrowser.$$"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "filebrowser-quantum" "addon"
# Get primary IP # Get primary IP
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}') IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1) IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)

View File

@@ -29,6 +29,10 @@ INSTALL_PATH="/usr/local/bin/filebrowser"
DB_PATH="/usr/local/community-scripts/filebrowser.db" DB_PATH="/usr/local/community-scripts/filebrowser.db"
DEFAULT_PORT=8080 DEFAULT_PORT=8080
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "filebrowser" "addon"
# Get first non-loopback IP & Detect primary network interface dynamically # Get first non-loopback IP & Detect primary network interface dynamically
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}') IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1) IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)

View File

@@ -30,6 +30,10 @@ function msg_info() { echo -e "${INFO} ${YW}$1...${CL}"; }
function msg_ok() { echo -e "${CM} ${GN}$1${CL}"; } function msg_ok() { echo -e "${CM} ${GN}$1${CL}"; }
function msg_error() { echo -e "${CROSS} ${RD}$1${CL}"; } function msg_error() { echo -e "${CROSS} ${RD}$1${CL}"; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "glances" "addon"
get_lxc_ip() { get_lxc_ip() {
if command -v hostname >/dev/null 2>&1 && hostname -I 2>/dev/null; then if command -v hostname >/dev/null 2>&1 && hostname -I 2>/dev/null; then
hostname -I | awk '{print $1}' hostname -I | awk '{print $1}'

View File

@@ -13,6 +13,7 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
@@ -29,6 +30,7 @@ DEFAULT_PORT=3000
# Initialize all core functions (colors, formatting, icons, STD mode) # Initialize all core functions (colors, formatting, icons, STD mode)
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# HEADER # HEADER

View File

@@ -13,6 +13,7 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
@@ -29,6 +30,7 @@ DEFAULT_PORT=3000
# Initialize all core functions (colors, formatting, icons, STD mode) # Initialize all core functions (colors, formatting, icons, STD mode)
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# HEADER # HEADER

View File

@@ -26,6 +26,11 @@ BFR="\\r\\033[K"
HOLD="-" HOLD="-"
CM="${GN}${CL}" CM="${GN}${CL}"
silent() { "$@" >/dev/null 2>&1; } silent() { "$@" >/dev/null 2>&1; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "netdata" "tool"
set -e set -e
header_info header_info
echo "Loading..." echo "Loading..."

View File

@@ -13,11 +13,13 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# CONFIGURATION # CONFIGURATION

View File

@@ -27,6 +27,11 @@ HOLD="-"
CM="${GN}${CL}" CM="${GN}${CL}"
APP="OliveTin" APP="OliveTin"
hostname="$(hostname)" hostname="$(hostname)"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "olivetin" "addon"
set-e set-e
header_info header_info

View File

@@ -29,6 +29,10 @@ APP="phpMyAdmin"
INSTALL_DIR_DEBIAN="/var/www/html/phpMyAdmin" INSTALL_DIR_DEBIAN="/var/www/html/phpMyAdmin"
INSTALL_DIR_ALPINE="/usr/share/phpmyadmin" INSTALL_DIR_ALPINE="/usr/share/phpmyadmin"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "phpmyadmin" "addon"
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}') IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1) IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
[[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}') [[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}')

View File

@@ -13,11 +13,13 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# CONFIGURATION # CONFIGURATION

View File

@@ -8,11 +8,13 @@
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# CONFIGURATION # CONFIGURATION

View File

@@ -28,6 +28,11 @@ function msg_error() {
local msg="$1" local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pyenv" "addon"
if command -v pveversion >/dev/null 2>&1; then if command -v pveversion >/dev/null 2>&1; then
msg_error "Can't Install on Proxmox " msg_error "Can't Install on Proxmox "
exit exit

View File

@@ -13,11 +13,13 @@ fi
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
# Enable error handling # Enable error handling
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
load_functions load_functions
init_tool_telemetry "" "addon"
# ============================================================================== # ==============================================================================
# CONFIGURATION # CONFIGURATION

View File

@@ -36,6 +36,10 @@ msg_ok() {
echo -e "${BFR} ${CM} ${GN}${msg}${CL}" echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "webmin" "addon"
header_info header_info
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Webmin Installer" --yesno "This Will Install Webmin on this LXC Container. Proceed?" 10 58 whiptail --backtitle "Proxmox VE Helper Scripts" --title "Webmin Installer" --yesno "This Will Install Webmin on this LXC Container. Proceed?" 10 58

View File

@@ -31,6 +31,10 @@ HOLD=" "
CM="${GN}${CL} " CM="${GN}${CL} "
CROSS="${RD}${CL} " CROSS="${RD}${CL} "
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-iptag" "tool"
# Stop any running spinner # Stop any running spinner
stop_spinner() { stop_spinner() {
if [ -n "$SPINNER_PID" ] && kill -0 "$SPINNER_PID" 2>/dev/null; then if [ -n "$SPINNER_PID" ] && kill -0 "$SPINNER_PID" 2>/dev/null; then

View File

@@ -22,6 +22,10 @@ CM='\xE2\x9C\x94\033'
GN="\033[1;92m" GN="\033[1;92m"
CL="\033[m" CL="\033[m"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "clean-lxcs" "tool"
header_info header_info
echo "Loading..." echo "Loading..."

View File

@@ -16,6 +16,10 @@ function header_info {
EOF EOF
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "clean-orphaned-lvm" "tool"
# Function to check for orphaned LVM volumes # Function to check for orphaned LVM volumes
function find_orphaned_lvm { function find_orphaned_lvm {
echo -e "\n🔍 Scanning for orphaned LVM volumes...\n" echo -e "\n🔍 Scanning for orphaned LVM volumes...\n"

View File

@@ -44,6 +44,10 @@ EOF
header_info header_info
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "container-restore" "tool"
function msg_info() { function msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..." echo -ne " ${HOLD} ${YW}${msg}..."

View File

@@ -44,6 +44,10 @@ EOF
header_info header_info
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "core-restore" "tool"
function msg_info() { function msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..." echo -ne " ${HOLD} ${YW}${msg}..."

View File

@@ -22,6 +22,11 @@ RD=$(echo "\033[01;31m")
CM='\xE2\x9C\x94\033' CM='\xE2\x9C\x94\033'
GN=$(echo "\033[1;92m") GN=$(echo "\033[1;92m")
CL=$(echo "\033[m") CL=$(echo "\033[m")
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "execute-lxcs" "tool"
header_info header_info
echo "Loading..." echo "Loading..."
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Execute" --yesno "This will execute a command inside selected LXC Containers. Proceed?" 10 58 whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Execute" --yesno "This will execute a command inside selected LXC Containers. Proceed?" 10 58
@@ -40,7 +45,6 @@ if [ $? -ne 0 ]; then
exit exit
fi fi
read -r -p "Enter here command for inside the containers: " custom_command read -r -p "Enter here command for inside the containers: " custom_command
header_info header_info
@@ -50,8 +54,7 @@ function execute_in() {
container=$1 container=$1
name=$(pct exec "$container" hostname) name=$(pct exec "$container" hostname)
echo -e "${BL}[Info]${GN} Execute inside${BL} ${name}${GN} with output: ${CL}" echo -e "${BL}[Info]${GN} Execute inside${BL} ${name}${GN} with output: ${CL}"
if ! pct exec "$container" -- bash -c "command ${custom_command} >/dev/null 2>&1" if ! pct exec "$container" -- bash -c "command ${custom_command} >/dev/null 2>&1"; then
then
echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container has no command: ${custom_command}" echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container has no command: ${custom_command}"
else else
pct exec "$container" -- bash -c "${custom_command}" | tee pct exec "$container" -- bash -c "${custom_command}" | tee

View File

@@ -15,6 +15,11 @@ function header_info {
/___/ /_/ /_/ /___/ /_/ /_/
EOF EOF
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "frigate-support" "tool"
header_info header_info
while true; do while true; do
read -p "This will Prepare a LXC Container for Frigate. Proceed (y/n)?" yn read -p "This will Prepare a LXC Container for Frigate. Proceed (y/n)?" yn

View File

@@ -19,6 +19,10 @@ RD="\033[01;31m"
GN="\033[1;92m" GN="\033[1;92m"
CL="\033[m" CL="\033[m"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "fstrim" "tool"
LOGFILE="/var/log/fstrim.log" LOGFILE="/var/log/fstrim.log"
touch "$LOGFILE" touch "$LOGFILE"
chmod 600 "$LOGFILE" chmod 600 "$LOGFILE"

View File

@@ -16,6 +16,10 @@ function header_info {
EOF EOF
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "host-backup" "tool"
# Function to perform backup # Function to perform backup
function perform_backup { function perform_backup {
local BACKUP_PATH local BACKUP_PATH

View File

@@ -29,6 +29,11 @@ BFR="\\r\\033[K"
HOLD="-" HOLD="-"
CM="${GN}${CL}" CM="${GN}${CL}"
set -e set -e
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "hw-acceleration" "tool"
header_info header_info
echo "Loading..." echo "Loading..."
function msg_info() { function msg_info() {

View File

@@ -22,6 +22,10 @@ GN="\033[1;92m"
RD="\033[01;31m" RD="\033[01;31m"
CL="\033[m" CL="\033[m"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "kernel-clean" "tool"
# Detect current kernel # Detect current kernel
current_kernel=$(uname -r) current_kernel=$(uname -r)
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print $2}' | grep -v "$current_kernel" | sort -V) available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print $2}' | grep -v "$current_kernel" | sort -V)

View File

@@ -25,6 +25,11 @@ HOLD="-"
CM="${GN}${CL}" CM="${GN}${CL}"
current_kernel=$(uname -r) current_kernel=$(uname -r)
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print substr($2, 16, length($2)-22)}') available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print substr($2, 16, length($2)-22)}')
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "kernel-pin" "tool"
header_info header_info
function msg_info() { function msg_info() {

View File

@@ -38,6 +38,10 @@ CL=$(echo "\033[m")
TAB=" " TAB=" "
CM="${TAB}✔️${TAB}${CL}" CM="${TAB}✔️${TAB}${CL}"
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "lxc-delete" "tool"
header_info header_info
echo "Loading..." echo "Loading..."
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Deletion" --yesno "This will delete LXC containers. Proceed?" 10 58 whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Deletion" --yesno "This will delete LXC containers. Proceed?" 10 58

View File

@@ -29,6 +29,10 @@ msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; } msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; } msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "microcode" "tool"
header_info header_info
current_microcode=$(journalctl -k | grep -i 'microcode: Current revision:' | grep -oP 'Current revision: \K0x[0-9a-f]+') current_microcode=$(journalctl -k | grep -i 'microcode: Current revision:' | grep -oP 'Current revision: \K0x[0-9a-f]+')
[ -z "$current_microcode" ] && current_microcode="Not found." [ -z "$current_microcode" ] && current_microcode="Not found."

View File

@@ -15,6 +15,10 @@ cat <<"EOF"
EOF EOF
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "monitor-all" "tool"
add() { add() {
echo -e "\n IMPORTANT: Tag-Based Monitoring Enabled" echo -e "\n IMPORTANT: Tag-Based Monitoring Enabled"
echo "Only VMs and containers with the tag 'mon-restart' will be automatically restarted by this service." echo "Only VMs and containers with the tag 'mon-restart' will be automatically restarted by this service."
@@ -175,5 +179,8 @@ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Monitor-All f
case $CHOICE in case $CHOICE in
"Add") add ;; "Add") add ;;
"Remove") remove ;; "Remove") remove ;;
*) echo "Exiting..."; exit 0 ;; *)
echo "Exiting..."
exit 0
;;
esac esac

View File

@@ -19,8 +19,8 @@ INFO="${TAB}${TAB}${CL}"
WARN="${TAB}⚠️${TAB}${CL}" WARN="${TAB}⚠️${TAB}${CL}"
function header_info { function header_info {
clear clear
cat <<"EOF" cat <<"EOF"
_ ____________ ____ __________ ___ ____ _ __ __ _ ____________ ____ __________ ___ ____ _ __ __
/ | / / _/ ____/ / __ \/ __/ __/ /___ ____ _____/ (_)___ ____ _ / __ \(_)________ _/ /_ / /__ _____ / | / / _/ ____/ / __ \/ __/ __/ /___ ____ _____/ (_)___ ____ _ / __ \(_)________ _/ /_ / /__ _____
@@ -33,6 +33,10 @@ Enhanced version supporting both e1000e and e1000 drivers
EOF EOF
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "nic-offloading-fix" "tool"
header_info header_info
function msg_info() { echo -e "${INFO} ${YW}${1}...${CL}"; } function msg_info() { echo -e "${INFO} ${YW}${1}...${CL}"; }
@@ -49,7 +53,10 @@ fi
if ! command -v ethtool >/dev/null 2>&1; then if ! command -v ethtool >/dev/null 2>&1; then
msg_info "Installing ethtool" msg_info "Installing ethtool"
apt-get update &>/dev/null apt-get update &>/dev/null
apt-get install -y ethtool &>/dev/null || { msg_error "Failed to install ethtool. Exiting."; exit 1; } apt-get install -y ethtool &>/dev/null || {
msg_error "Failed to install ethtool. Exiting."
exit 1
}
msg_ok "ethtool installed successfully" msg_ok "ethtool installed successfully"
fi fi
@@ -86,8 +93,8 @@ msg_ok "Found ${BL}$COUNT${GN} Intel e1000e/e1000 interfaces"
# Create a checklist for interface selection with all interfaces initially checked # Create a checklist for interface selection with all interfaces initially checked
INTERFACES_CHECKLIST=() INTERFACES_CHECKLIST=()
for ((i=0; i<${#INTERFACES[@]}; i+=2)); do for ((i = 0; i < ${#INTERFACES[@]}; i += 2)); do
INTERFACES_CHECKLIST+=("${INTERFACES[i]}" "${INTERFACES[i+1]}" "ON") INTERFACES_CHECKLIST+=("${INTERFACES[i]}" "${INTERFACES[i + 1]}" "ON")
done done
# Show interface selection checklist # Show interface selection checklist
@@ -108,7 +115,7 @@ if [ -z "$SELECTED_INTERFACES" ]; then
fi fi
# Convert the selected interfaces into an array # Convert the selected interfaces into an array
readarray -t INTERFACE_ARRAY <<< "$SELECTED_INTERFACES" readarray -t INTERFACE_ARRAY <<<"$SELECTED_INTERFACES"
# Show the number of selected interfaces # Show the number of selected interfaces
INTERFACE_COUNT=${#INTERFACE_ARRAY[@]} INTERFACE_COUNT=${#INTERFACE_ARRAY[@]}
@@ -148,7 +155,7 @@ for SELECTED_INTERFACE in "${INTERFACE_ARRAY[@]}"; do
msg_info "Creating systemd service for interface: ${BL}$SELECTED_INTERFACE${YW} (${BL}$DRIVER${YW})" msg_info "Creating systemd service for interface: ${BL}$SELECTED_INTERFACE${YW} (${BL}$DRIVER${YW})"
# Start with the common part of the service file # Start with the common part of the service file
cat > "$SERVICE_PATH" << EOF cat >"$SERVICE_PATH" <<EOF
[Unit] [Unit]
Description=Disable NIC offloading for Intel $DRIVER interface $SELECTED_INTERFACE Description=Disable NIC offloading for Intel $DRIVER interface $SELECTED_INTERFACE
After=network.target After=network.target
@@ -172,16 +179,20 @@ EOF
# Configure this service # Configure this service
{ {
echo "25"; sleep 0.2 echo "25"
sleep 0.2
# Reload systemd to recognize the new service # Reload systemd to recognize the new service
systemctl daemon-reload systemctl daemon-reload
echo "50"; sleep 0.2 echo "50"
sleep 0.2
# Start the service # Start the service
systemctl start "$SERVICE_NAME" systemctl start "$SERVICE_NAME"
echo "75"; sleep 0.2 echo "75"
sleep 0.2
# Enable the service to start on boot # Enable the service to start on boot
systemctl enable "$SERVICE_NAME" systemctl enable "$SERVICE_NAME"
echo "100"; sleep 0.2 echo "100"
sleep 0.2
} | whiptail --backtitle "Intel e1000e/e1000 NIC Offloading Disabler" --gauge "Configuring service for $SELECTED_INTERFACE..." 10 80 0 } | whiptail --backtitle "Intel e1000e/e1000 NIC Offloading Disabler" --gauge "Configuring service for $SELECTED_INTERFACE..." 10 80 0
# Individual service status # Individual service status

View File

@@ -44,6 +44,10 @@ msg_error() {
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pbs3-upgrade" "tool"
start_routines() { start_routines() {
header_info header_info
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PBS 2 BACKUP" --menu "\nMake a backup of /etc/proxmox-backup to ensure that in the worst case, any relevant configuration can be recovered?" 14 58 2 \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PBS 2 BACKUP" --menu "\nMake a backup of /etc/proxmox-backup to ensure that in the worst case, any relevant configuration can be recovered?" 14 58 2 \

View File

@@ -32,6 +32,10 @@ msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; } msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; } msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pbs4-upgrade" "tool"
start_routines() { start_routines() {
header_info header_info
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PBS 3 BACKUP" --menu \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PBS 3 BACKUP" --menu \

View File

@@ -28,6 +28,10 @@ CM="${GN}✓${CL}"
CROSS="${RD}${CL}" CROSS="${RD}${CL}"
msg_info() { echo -ne " ${HOLD} ${YW}$1..."; } msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pbs-microcode" "tool"
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; } msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; } msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }

View File

@@ -32,6 +32,10 @@ msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; } msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; } msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pbs-install" "tool"
# ---- helpers ---- # ---- helpers ----
get_pbs_codename() { get_pbs_codename() {
awk -F'=' '/^VERSION_CODENAME=/{print $2}' /etc/os-release awk -F'=' '/^VERSION_CODENAME=/{print $2}' /etc/os-release

View File

@@ -43,6 +43,10 @@ msg_error() {
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pmg-install" "tool"
if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null; then if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null; then
msg_error "This script is only intended for Proxmox Mail Gateway" msg_error "This script is only intended for Proxmox Mail Gateway"
exit 1 exit 1

View File

@@ -44,6 +44,10 @@ msg_error() {
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pve-install" "tool"
get_pve_version() { get_pve_version() {
local pve_ver local pve_ver
pve_ver="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" pve_ver="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')"

View File

@@ -11,7 +11,9 @@ if ! command -v curl >/dev/null 2>&1; then
apt-get install -y curl >/dev/null 2>&1 apt-get install -y curl >/dev/null 2>&1
fi fi
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/core.func) source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
load_functions load_functions
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pve-privilege-converter" "tool"
set -euo pipefail set -euo pipefail
shopt -s inherit_errexit nullglob shopt -s inherit_errexit nullglob

View File

@@ -44,6 +44,10 @@ msg_error() {
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pve8-upgrade" "tool"
start_routines() { start_routines() {
header_info header_info

View File

@@ -5,6 +5,11 @@
# License: MIT # License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
set -e set -e
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "scaling-governor" "tool"
header_info() { header_info() {
clear clear
cat <<EOF cat <<EOF

View File

@@ -5,6 +5,8 @@
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/core.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "update-apps" "tool"
# ============================================================================= # =============================================================================
# CONFIGURATION VARIABLES # CONFIGURATION VARIABLES
@@ -98,11 +100,11 @@ EOF
# Handle command line arguments # Handle command line arguments
case "${1:-}" in case "${1:-}" in
--help|-h) --help | -h)
print_usage print_usage
exit 0 exit 0
;; ;;
--export-config) --export-config)
export_config_json export_config_json
exit 0 exit 0
;; ;;
@@ -205,7 +207,7 @@ if [[ -n "$var_container" ]]; then
all) all)
# Select all containers with matching tags # Select all containers with matching tags
CHOICE="" CHOICE=""
for ((i=0; i<${#menu_items[@]}; i+=3)); do for ((i = 0; i < ${#menu_items[@]}; i += 3)); do
CHOICE="$CHOICE ${menu_items[$i]}" CHOICE="$CHOICE ${menu_items[$i]}"
done done
CHOICE=$(echo "$CHOICE" | xargs) CHOICE=$(echo "$CHOICE" | xargs)
@@ -213,7 +215,7 @@ if [[ -n "$var_container" ]]; then
all_running) all_running)
# Select only running containers with matching tags # Select only running containers with matching tags
CHOICE="" CHOICE=""
for ((i=0; i<${#menu_items[@]}; i+=3)); do for ((i = 0; i < ${#menu_items[@]}; i += 3)); do
cid="${menu_items[$i]}" cid="${menu_items[$i]}"
if pct status "$cid" 2>/dev/null | grep -q "running"; then if pct status "$cid" 2>/dev/null | grep -q "running"; then
CHOICE="$CHOICE $cid" CHOICE="$CHOICE $cid"
@@ -224,7 +226,7 @@ if [[ -n "$var_container" ]]; then
all_stopped) all_stopped)
# Select only stopped containers with matching tags # Select only stopped containers with matching tags
CHOICE="" CHOICE=""
for ((i=0; i<${#menu_items[@]}; i+=3)); do for ((i = 0; i < ${#menu_items[@]}; i += 3)); do
cid="${menu_items[$i]}" cid="${menu_items[$i]}"
if pct status "$cid" 2>/dev/null | grep -q "stopped"; then if pct status "$cid" 2>/dev/null | grep -q "stopped"; then
CHOICE="$CHOICE $cid" CHOICE="$CHOICE $cid"

View File

@@ -24,6 +24,11 @@ RD=$(echo "\033[01;31m")
CM='\xE2\x9C\x94\033' CM='\xE2\x9C\x94\033'
GN=$(echo "\033[1;92m") GN=$(echo "\033[1;92m")
CL=$(echo "\033[m") CL=$(echo "\033[m")
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "update-lxcs" "tool"
header_info header_info
echo "Loading..." echo "Loading..."
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Updater" --yesno "This Will Update LXC Containers. Proceed?" 10 58 whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Updater" --yesno "This Will Update LXC Containers. Proceed?" 10 58

View File

@@ -23,6 +23,10 @@ RD=$(echo "\033[01;31m")
GN=$(echo "\033[1;92m") GN=$(echo "\033[1;92m")
CL=$(echo "\033[m") CL=$(echo "\033[m")
# Telemetry
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "update-repo" "tool"
header_info header_info
echo "Loading..." echo "Loading..."
NODE=$(hostname) NODE=$(hostname)