mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-19 03:25:55 +01:00
Compare commits
4 Commits
automated/
...
feature/to
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96991c347a | ||
|
|
8864e9aa9d | ||
|
|
16a0329af3 | ||
|
|
50effb6d86 |
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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}'
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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..."
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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}')
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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..."
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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}..."
|
||||||
|
|||||||
@@ -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}..."
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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."
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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 \
|
||||||
|
|||||||
@@ -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 \
|
||||||
|
|||||||
@@ -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}"; }
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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}')"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user