mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 07:10:51 +02:00
Replace wget with curl -fsSL, normalize downloads, and prep for IPv6 (#3455)
* Initial Call, Switch from curl -s to curl -fsSL and wget to curl -fssL * more switches * switch vms * more curls * More curls * more * more * more changes * more * prepare ipv6 calls * change frontend to ipv6 * Formatting * Fromatting * Update gomft.sh * Update gomft-install.sh * Update ersatztv.sh * Update build.func --------- Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
# Source: https://github.com/gitsang/lxc-iptag
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
__ _ ________ ________ ______
|
||||
/ / | |/ / ____/ / _/ __ \ /_ __/___ _____ _
|
||||
/ / | / / / // /_/ /_____/ / / __ `/ __ `/
|
||||
@@ -60,9 +60,9 @@ spinner() {
|
||||
local color="${YWB}"
|
||||
|
||||
while true; do
|
||||
printf "\r ${color}%s${CL}" "${frames[spin_i]}"
|
||||
spin_i=$(((spin_i + 1) % ${#frames[@]}))
|
||||
sleep "$interval"
|
||||
printf "\r ${color}%s${CL}" "${frames[spin_i]}"
|
||||
spin_i=$(((spin_i + 1) % ${#frames[@]}))
|
||||
sleep "$interval"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ while true; do
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*)
|
||||
msg_error "Installation cancelled."
|
||||
exit
|
||||
;;
|
||||
msg_error "Installation cancelled."
|
||||
exit
|
||||
;;
|
||||
*) msg_error "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
_ __ __ ____ _ __
|
||||
/ | / /__ / /_/ __ )(_)________/ /
|
||||
/ |/ / _ \/ __/ __ / / ___/ __ /
|
||||
@@ -80,7 +80,7 @@ header_info
|
||||
msg "Installing NetBird..."
|
||||
pct exec "$CTID" -- bash -c '
|
||||
apt install -y ca-certificates gpg &>/dev/null
|
||||
wget -qO- https://pkgs.netbird.io/debian/public.key | gpg --dearmor >/usr/share/keyrings/netbird-archive-keyring.gpg
|
||||
curl -fsSL "https://pkgs.netbird.io/debian/public.key" | gpg --dearmor >/usr/share/keyrings/netbird-archive-keyring.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/netbird-archive-keyring.gpg] https://pkgs.netbird.io/debian stable main" >/etc/apt/sources.list.d/netbird.list
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y netbird-ui &>/dev/null
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
______ _ __ __
|
||||
/_ __/___ _(_) /_____________ _/ /__
|
||||
/ / / __ `/ / / ___/ ___/ __ `/ / _ \
|
||||
@@ -62,7 +62,7 @@ msg "Installing Tailscale..."
|
||||
pct exec "$CTID" -- bash -c '
|
||||
ID=$(grep "^ID=" /etc/os-release | cut -d"=" -f2)
|
||||
VER=$(grep "^VERSION_CODENAME=" /etc/os-release | cut -d"=" -f2)
|
||||
wget -qO- https://pkgs.tailscale.com/stable/$ID/$VER.noarmor.gpg >/usr/share/keyrings/tailscale-archive-keyring.gpg
|
||||
curl -fsSL https://pkgs.tailscale.com/stable/$ID/$VER.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
|
||||
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/$ID $VER main" >/etc/apt/sources.list.d/tailscale.list
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y tailscale &>/dev/null
|
||||
|
||||
@@ -194,6 +194,6 @@ customize() {
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
|
||||
echo "bash -c \"\$(curl -fsSL https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
||||
echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
||||
chmod +x /usr/bin/update
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ post_to_api() {
|
||||
EOF
|
||||
)
|
||||
|
||||
RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||
RESPONSE=$(curl -fsSL -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$JSON_PAYLOAD") || true
|
||||
}
|
||||
@@ -87,7 +87,7 @@ post_to_api_vm() {
|
||||
EOF
|
||||
)
|
||||
|
||||
RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||
RESPONSE=$(curl -fsSL -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$JSON_PAYLOAD") || true
|
||||
}
|
||||
@@ -115,7 +115,7 @@ post_update_to_api() {
|
||||
EOF
|
||||
)
|
||||
|
||||
RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||
RESPONSE=$(curl -fsSL -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$JSON_PAYLOAD") || true
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ variables() {
|
||||
RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" # generates a random UUID and sets it to the RANDOM_UUID variable.
|
||||
}
|
||||
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
# This function sets various color variables using ANSI escape codes for formatting text in the terminal.
|
||||
color() {
|
||||
@@ -67,7 +67,7 @@ catch_errors() {
|
||||
|
||||
# This function is called when an error occurs. It receives the exit code, line number, and command that caused the error, and displays an error message.
|
||||
error_handler() {
|
||||
source /dev/stdin <<<$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local exit_code="$?"
|
||||
@@ -289,14 +289,14 @@ update_motd_ip() {
|
||||
# Function to download & save header files
|
||||
get_header() {
|
||||
local app_name=$(echo ${APP,,} | tr -d ' ')
|
||||
local header_url="https://github.com/community-scripts/ProxmoxVE/raw/main/ct/headers/${app_name}"
|
||||
local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/ct/headers/${app_name}"
|
||||
local local_header_path="/usr/local/community-scripts/headers/${app_name}"
|
||||
|
||||
mkdir -p "/usr/local/community-scripts/headers"
|
||||
|
||||
# Check if local file already present
|
||||
if [ ! -s "$local_header_path" ]; then
|
||||
wget -qO "$local_header_path" "$header_url"
|
||||
curl -fsSL "$header_url" -o "$local_header_path"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${WARN}${BOLD}${YLW}Failed to download header for ${app_name}. No header will be displayed.${CL}"
|
||||
return 1
|
||||
@@ -1097,9 +1097,9 @@ build_container() {
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
pushd $TEMP_DIR >/dev/null
|
||||
if [ "$var_os" == "alpine" ]; then
|
||||
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)"
|
||||
export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)"
|
||||
else
|
||||
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)"
|
||||
export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)"
|
||||
fi
|
||||
export RANDOM_UUID="$RANDOM_UUID"
|
||||
export CACHER="$APT_CACHER"
|
||||
@@ -1131,7 +1131,7 @@ build_container() {
|
||||
$PW
|
||||
"
|
||||
# This executes create_lxc.sh and creates the container and .conf file
|
||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" || exit $?
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" || exit $?
|
||||
|
||||
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
|
||||
if [ "$CT_TYPE" == "0" ]; then
|
||||
@@ -1193,7 +1193,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
|
||||
EOF'
|
||||
pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
|
||||
fi
|
||||
lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit $?
|
||||
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit $?
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -33,14 +33,14 @@ while read -r TAG ITEM; do
|
||||
EXCLUDE_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --checklist "\nSelect containers to skip from cleaning:\n" \
|
||||
16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
function clean_container() {
|
||||
container=$1
|
||||
header_info
|
||||
name=$(pct exec "$container" hostname)
|
||||
echo -e "${BL}[Info]${GN} Cleaning ${name} ${CL} \n"
|
||||
pct exec $container -- bash -c "apt-get -y --purge autoremove && apt-get -y autoclean && bash <(curl -fsSL https://github.com/community-scripts/ProxmoxVE/raw/main/misc/clean.sh) && rm -rf /var/lib/apt/lists/* && apt-get update"
|
||||
pct exec $container -- bash -c "apt-get -y --purge autoremove && apt-get -y autoclean && bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/clean.sh) && rm -rf /var/lib/apt/lists/* && apt-get update"
|
||||
}
|
||||
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ ________ ____ __ __ __ _ ____ ___
|
||||
/ __ \_________ _ ______ ___ ____ _ __ / ____/ /__ ____ _____ / __ \_________ / /_ ____ _____ ___ ____/ / / /| | / / |/ /____
|
||||
/ /_/ / ___/ __ \| |/_/ __ `__ \/ __ \| |/_/ / / / / _ \/ __ `/ __ \ / / / / ___/ __ \/ __ \/ __ `/ __ \/ _ \/ __ / / / | | / / /|_/ / ___/
|
||||
@@ -38,19 +38,19 @@ function find_orphaned_lvm {
|
||||
echo -e "❗ The following orphaned LVM volumes were found:\n"
|
||||
printf "%-25s %-10s %-10s\n" "LV Name" "VG" "Size"
|
||||
printf "%-25s %-10s %-10s\n" "-------------------------" "----------" "----------"
|
||||
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i+=3)); do
|
||||
printf "%-25s %-10s %-10s\n" "${orphaned_volumes[i]}" "${orphaned_volumes[i+1]}" "${orphaned_volumes[i+2]}"
|
||||
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i += 3)); do
|
||||
printf "%-25s %-10s %-10s\n" "${orphaned_volumes[i]}" "${orphaned_volumes[i + 1]}" "${orphaned_volumes[i + 2]}"
|
||||
done
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Function to delete selected volumes
|
||||
function delete_orphaned_lvm {
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i+=3)); do
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i += 3)); do
|
||||
lv="${orphaned_volumes[i]}"
|
||||
vg="${orphaned_volumes[i+1]}"
|
||||
size="${orphaned_volumes[i+2]}"
|
||||
vg="${orphaned_volumes[i + 1]}"
|
||||
size="${orphaned_volumes[i + 2]}"
|
||||
|
||||
read -p "❓ Do you want to delete $lv (VG: $vg, Size: $size)? [y/N]: " confirm
|
||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
||||
|
||||
@@ -46,8 +46,14 @@ function error_exit() {
|
||||
}
|
||||
clear
|
||||
header_info
|
||||
if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Install on Proxmox "; exit; fi
|
||||
if [ -e /etc/alpine-release ]; then echo -e "⚠️ Can't Install on Alpine"; exit; fi
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Can't Install on Proxmox "
|
||||
exit
|
||||
fi
|
||||
if [ -e /etc/alpine-release ]; then
|
||||
echo -e "⚠️ Can't Install on Alpine"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -73,7 +79,7 @@ apt-get install -y curl &>/dev/null
|
||||
apt-get install -y git &>/dev/null
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
VERSION=$(curl -s https://api.github.com/repos/coder/code-server/releases/latest |
|
||||
VERSION=$(curl -fsSL https://api.github.com/repos/coder/code-server/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
clear
|
||||
if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Run from the Proxmox Shell"; exit; fi
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Can't Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
|
||||
@@ -2,45 +2,45 @@
|
||||
<div align="center"> To copy data from Home Assistant Container to Home Assistant Container </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-container.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-container.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Home Assistant Container to Home Assistant Core </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-core.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-core.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Home Assistant Container to Podman Home Assistant </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-container-copy-data-podman-home-assistant.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-container-copy-data-podman-home-assistant.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Podman Home Assistant to Home Assistant Container </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/podman-home-assistant-copy-data-home-assistant-container.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/podman-home-assistant-copy-data-home-assistant-container.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Home Assistant Core to Home Assistant Container </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-container.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-container.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Home Assistant Core to Home Assistant Core </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-core.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-core.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Plex to Plex </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/plex-copy-data-plex.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/plex-copy-data-plex.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Zigbee2MQTT to Zigbee2MQTT </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/z2m-copy-data-z2m.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/z2m-copy-data-z2m.sh)"
|
||||
```
|
||||
<div align="center"> To copy data from Zwavejs2MQTT to Zwave JS UI </div>
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/zwavejs2mqtt-copy-data-zwavejsui.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/zwavejs2mqtt-copy-data-zwavejsui.sh)"
|
||||
```
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
# Use to copy all data from one Home Assistant LXC to another
|
||||
# run from the Proxmox Shell
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from one Home Assistant LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -125,4 +128,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from one Home Assistant LXC to another
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-container.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-container.sh)"
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant Container LXC to a Home Assistant Core LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -121,4 +124,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from a Home Assistant Container LXC to a Home Assistant Core LXC
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-core.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-container-copy-data-home-assistant-core.sh)"
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
# Use to copy all data from a Home Assistant LXC to a Podman Home Assistant LXC.
|
||||
# run from the Proxmox Shell
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant LXC to a Podman Home Assistant LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -126,4 +129,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from a Home Assistant LXC to a Podman Home Assistant LXC
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-container-copy-data-podman-home-assistant.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-container-copy-data-podman-home-assistant.sh)"
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant Core LXC to a Home Assistant Container LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -121,4 +124,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from a Home Assistant Core LXC to a Home Assistant Container LXC
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-container.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-container.sh)"
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant Core LXC to a Home Assistant Core LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -120,4 +123,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from a Home Assistant Core LXC to a Home Assistant Container LXC
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-core.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/home-assistant-core-copy-data-home-assistant-core.sh)"
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
# Use to copy all data from one Plex Media Server LXC to another
|
||||
# run from the Proxmox Shell
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from one Plex Media Server LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -125,4 +128,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from one Plex Media Server LXC to another
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/plex-copy-data-plex.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/plex-copy-data-plex.sh)"
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
# Use to copy all data from a Podman Home Assistant LXC to a Docker Home Assistant LXC.
|
||||
# run from the Proxmox Shell
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Podman Home Assistant LXC to a Docker Home Assistant LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -126,4 +129,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from a Podman Home Assistant LXC to a Docker Home Assistant LXC.
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/podman-home-assistant-copy-data-home-assistant-container.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/podman-home-assistant-copy-data-home-assistant-container.sh)"
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
# Use to copy all data from one Zigbee2MQTT LXC to another
|
||||
# run from the Proxmox Shell
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from one Zigbee2MQTT LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -125,4 +128,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from one Zigbee2MQTT LXC to another
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/z2m-copy-data-z2m.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/z2m-copy-data-z2m.sh)"
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
# Use to copy all data from a Zwavejs2MQTT LXC to a Z-wave JS UI LXC
|
||||
# run from the Proxmox Shell
|
||||
clear
|
||||
if ! command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Run from the Proxmox Shell"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Zwavejs2MQTT LXC to a Z-wave JS UI LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -127,4 +130,4 @@ info "Successfully Transferred Data."
|
||||
|
||||
# Use to copy all data from a Zwavejs2MQTT LXC to a Z-wave JS UI LXC
|
||||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/copy-data/zwavejs2mqtt-copy-data-zwavejsui.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/copy-data/zwavejs2mqtt-copy-data-zwavejsui.sh)"
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
clear
|
||||
if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Run from the Proxmox Shell"; exit; fi
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Can't Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/cron-update-lxcs.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/cron-update-lxcs.sh)"
|
||||
|
||||
clear
|
||||
cat <<"EOF"
|
||||
@@ -25,7 +25,7 @@ add() {
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * 0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -'
|
||||
sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * 0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -'
|
||||
clear
|
||||
echo -e "\n To view Cron Update LXCs logs: cat /var/log/update-lxcs-cron.log"
|
||||
}
|
||||
|
||||
@@ -33,7 +33,10 @@ function error_exit() {
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Install on Proxmox "; exit; fi
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Can't Install on Proxmox "
|
||||
exit
|
||||
fi
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
@@ -70,7 +73,7 @@ msg_info "Setting up ${APP} Repository"
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y curl &>/dev/null
|
||||
apt-get install -y gnupg &>/dev/null
|
||||
curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | bash &>/dev/null
|
||||
curl -fsSL https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | bash &>/dev/null
|
||||
msg_ok "Setup ${APP} Repository"
|
||||
|
||||
msg_info "Installing ${APP}"
|
||||
|
||||
@@ -36,7 +36,6 @@ IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n
|
||||
[[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}')
|
||||
[[ -z "$IP" ]] && IP="127.0.0.1"
|
||||
|
||||
|
||||
# Detect OS
|
||||
if [[ -f "/etc/alpine-release" ]]; then
|
||||
OS="Alpine"
|
||||
@@ -89,7 +88,7 @@ if [ -f "$INSTALL_PATH" ]; then
|
||||
read -r -p "Would you like to update ${APP}? (y/N): " update_prompt
|
||||
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Updating ${APP}"
|
||||
wget -qO- https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
chmod +x "$INSTALL_PATH"
|
||||
msg_ok "Updated ${APP}"
|
||||
exit 0
|
||||
@@ -107,7 +106,7 @@ read -r -p "Would you like to install ${APP}? (y/n): " install_prompt
|
||||
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing ${APP} on ${OS}"
|
||||
$PKG_MANAGER wget tar curl &>/dev/null
|
||||
wget -qO- https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
chmod +x "$INSTALL_PATH"
|
||||
msg_ok "Installed ${APP}"
|
||||
|
||||
@@ -115,9 +114,9 @@ if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
mkdir -p /usr/local/community-scripts
|
||||
chown root:root /usr/local/community-scripts
|
||||
chmod 755 /usr/local/community-scripts
|
||||
touch "$DB_PATH"
|
||||
chown root:root "$DB_PATH"
|
||||
chmod 644 "$DB_PATH"
|
||||
touch "$DB_PATH"
|
||||
chown root:root "$DB_PATH"
|
||||
chmod 644 "$DB_PATH"
|
||||
msg_ok "Directory created successfully"
|
||||
|
||||
read -r -p "Would you like to use No Authentication? (y/N): " auth_prompt
|
||||
@@ -141,7 +140,7 @@ if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
|
||||
msg_info "Creating service"
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
cat <<EOF > "$SERVICE_PATH"
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=Filebrowser
|
||||
After=network-online.target
|
||||
@@ -159,7 +158,7 @@ WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now filebrowser
|
||||
else
|
||||
cat <<EOF > "$SERVICE_PATH"
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
#!/sbin/openrc-run
|
||||
|
||||
command="/usr/local/bin/filebrowser"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ _ __ ____ __
|
||||
/ __/___(_)__ ____ _/ /____ / __/_ _____ ___ ___ ____/ /_
|
||||
/ _// __/ / _ `/ _ `/ __/ -_) _\ \/ // / _ \/ _ \/ _ \/ __/ __/
|
||||
@@ -28,11 +28,11 @@ header_info
|
||||
|
||||
# The array of device types
|
||||
# CHAR_DEVS+=(major:minor)
|
||||
CHAR_DEVS+=("1:1") # mem
|
||||
CHAR_DEVS+=("29:0") # fb0
|
||||
CHAR_DEVS+=("188:.*") # ttyUSB*
|
||||
CHAR_DEVS+=("189:.*") # bus/usb/*
|
||||
CHAR_DEVS+=("226:0") # card0
|
||||
CHAR_DEVS+=("1:1") # mem
|
||||
CHAR_DEVS+=("29:0") # fb0
|
||||
CHAR_DEVS+=("188:.*") # ttyUSB*
|
||||
CHAR_DEVS+=("189:.*") # bus/usb/*
|
||||
CHAR_DEVS+=("226:0") # card0
|
||||
CHAR_DEVS+=("226:128") # renderD128
|
||||
|
||||
# Proccess char device string
|
||||
@@ -89,5 +89,5 @@ EOF
|
||||
echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m"
|
||||
|
||||
# In the Proxmox web shell run
|
||||
# bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/frigate-support.sh)"
|
||||
# Reboot the LXC to apply the changes
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/frigate-support.sh)"
|
||||
# Reboot the LXC to apply the changes
|
||||
|
||||
@@ -29,12 +29,12 @@ echo "Loading..."
|
||||
|
||||
ROOT_FS=$(df -Th "/" | awk 'NR==2 {print $2}')
|
||||
if [ "$ROOT_FS" != "ext4" ]; then
|
||||
echo "Root filesystem is not ext4. Exiting script."
|
||||
exit 1
|
||||
echo "Root filesystem is not ext4. Exiting script."
|
||||
exit 1
|
||||
fi
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" \
|
||||
--title "Proxmox VE LXC Filesystem Trim" \
|
||||
--yesno "The LXC containers will undergo the fstrim command. Proceed?" 10 58 || exit
|
||||
--title "Proxmox VE LXC Filesystem Trim" \
|
||||
--yesno "The LXC containers will undergo the fstrim command. Proceed?" 10 58 || exit
|
||||
|
||||
NODE=$(hostname)
|
||||
EXCLUDE_MENU=()
|
||||
@@ -47,12 +47,12 @@ while read -r TAG ITEM; do
|
||||
done < <(pct list | awk 'NR>1')
|
||||
|
||||
excluded_containers_raw=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
|
||||
--title "Containers on $NODE" \
|
||||
--checklist "\nSelect containers to skip from trimming:\n" \
|
||||
16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3)
|
||||
--title "Containers on $NODE" \
|
||||
--checklist "\nSelect containers to skip from trimming:\n" \
|
||||
16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
exit
|
||||
exit
|
||||
fi
|
||||
|
||||
excluded_containers=$(echo "$excluded_containers_raw" | tr -d '"')
|
||||
@@ -61,17 +61,17 @@ function trim_container() {
|
||||
local container=$1
|
||||
header_info
|
||||
echo -e "${BL}[Info]${GN} Trimming ${BL}$container${CL} \n"
|
||||
|
||||
|
||||
local before_trim
|
||||
before_trim=$(lvs | awk -F '[[:space:]]+' 'NR>1 && (/Data%|'"vm-$container"'/) {gsub(/%/, "", $7); print $7}')
|
||||
echo -e "${RD}Data before trim $before_trim%${CL}"
|
||||
|
||||
|
||||
pct fstrim "$container"
|
||||
|
||||
|
||||
local after_trim
|
||||
after_trim=$(lvs | awk -F '[[:space:]]+' 'NR>1 && (/Data%|'"vm-$container"'/) {gsub(/%/, "", $7); print $7}')
|
||||
echo -e "${GN}Data after trim $after_trim%${CL}"
|
||||
|
||||
|
||||
sleep 1.5
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
________
|
||||
/ ____/ /___ _____ ________ _____
|
||||
/ / __/ / __ `/ __ \/ ___/ _ \/ ___/
|
||||
@@ -32,13 +32,13 @@ hostname="$(hostname)"
|
||||
silent() { "$@" >/dev/null 2>&1; }
|
||||
set -e
|
||||
spinner() {
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
msg_info() {
|
||||
@@ -49,7 +49,7 @@ msg_info() {
|
||||
}
|
||||
|
||||
msg_ok() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
@@ -58,23 +58,23 @@ msg_ok() {
|
||||
install() {
|
||||
header_info
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
header_info
|
||||
read -r -p "Verbose mode? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
STD=""
|
||||
STD=""
|
||||
else
|
||||
STD="silent"
|
||||
STD="silent"
|
||||
fi
|
||||
msg_info "Installing $APP"
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
$STD bash -c "$(wget -qLO - https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh)"
|
||||
$STD bash -c "$(curl -fsSL https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh)"
|
||||
cat <<EOF >/etc/systemd/system/glances.service
|
||||
[Unit]
|
||||
Description=Glances - An eye on your system
|
||||
@@ -97,29 +97,29 @@ EOF
|
||||
uninstall() {
|
||||
header_info
|
||||
msg_info "Uninstalling $APP"
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
|
||||
systemctl disable -q --now glances
|
||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/uninstall.sh)"
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/uninstall.sh)"
|
||||
rm -rf /etc/systemd/system/glances.service
|
||||
msg_ok "Uninstalled $APP"
|
||||
msg_ok "Completed Successfully!\n"
|
||||
}
|
||||
|
||||
OPTIONS=(Install "Install $APP" \
|
||||
Uninstall "Uninstall $APP")
|
||||
OPTIONS=(Install "Install $APP"
|
||||
Uninstall "Uninstall $APP")
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "$APP" --menu "Select an option:" 10 58 2 \
|
||||
"${OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
"${OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
case $CHOICE in
|
||||
"Install")
|
||||
install
|
||||
;;
|
||||
"Uninstall")
|
||||
uninstall
|
||||
;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
"Install")
|
||||
install
|
||||
;;
|
||||
"Uninstall")
|
||||
uninstall
|
||||
;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Execute within the Proxmox shell
|
||||
# bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/hw-acceleration.sh)"
|
||||
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/hw-acceleration.sh)"
|
||||
|
||||
set -e
|
||||
function header_info {
|
||||
@@ -56,8 +56,8 @@ MSG_MAX_LENGTH=0
|
||||
privileged_containers=$(pct list | awk 'NR>1 && system("grep -q \047unprivileged: 1\047 /etc/pve/lxc/" $1 ".conf")')
|
||||
|
||||
if [ -z "$privileged_containers" ]; then
|
||||
whiptail --msgbox "No Privileged Containers Found." 10 58
|
||||
exit
|
||||
whiptail --msgbox "No Privileged Containers Found." 10 58
|
||||
exit
|
||||
fi
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
@@ -69,11 +69,11 @@ done < <(echo "$privileged_containers")
|
||||
privileged_container=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Privileged Containers on $NODE" --checklist "\nSelect a Container To Add Intel HW Acceleration:\n" 16 $((MSG_MAX_LENGTH + 23)) 6 "${PREV_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
header_info
|
||||
read -r -p "Verbose mode? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
STD=""
|
||||
else
|
||||
else
|
||||
STD="silent"
|
||||
fi
|
||||
fi
|
||||
header_info
|
||||
|
||||
cat <<EOF >>/etc/pve/lxc/${privileged_container}.conf
|
||||
|
||||
@@ -68,7 +68,7 @@ catch_errors() {
|
||||
|
||||
# This function handles errors
|
||||
error_handler() {
|
||||
source <(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local exit_code="$?"
|
||||
@@ -265,7 +265,7 @@ EOF
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
||||
echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
||||
chmod +x /usr/bin/update
|
||||
|
||||
if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then
|
||||
|
||||
@@ -40,7 +40,7 @@ echo -e "\n${YW}Select kernels to remove (comma-separated, e.g., 1,2):${CL}"
|
||||
read -r selected
|
||||
|
||||
# Parse selection
|
||||
IFS=',' read -r -a selected_indices <<< "$selected"
|
||||
IFS=',' read -r -a selected_indices <<<"$selected"
|
||||
kernels_to_remove=()
|
||||
|
||||
for index in "${selected_indices[@]}"; do
|
||||
|
||||
@@ -39,8 +39,8 @@ function msg_ok() {
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE Kernel Pin" --yesno "This will Pin/Unpin Kernel Images, Proceed?" 10 68 || exit
|
||||
|
||||
KERNEL_MENU=()
|
||||
MSG_MAX_LENGTH=0
|
||||
KERNEL_MENU=()
|
||||
MSG_MAX_LENGTH=0
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ __ _ ________ ____ __ __
|
||||
/ __ \_________ _ ______ ___ ____ _ __ / / | |/ / ____/ / __ \___ / /__ / /____
|
||||
/ /_/ / ___/ __ \| |/_/ __ `__ \/ __ \| |/_/ / / | / / / / / / _ \/ / _ \/ __/ _ \
|
||||
@@ -20,7 +20,7 @@ spinner() {
|
||||
local pid=$1
|
||||
local delay=0.1
|
||||
local spinstr='|/-\'
|
||||
while ps -p $pid > /dev/null; do
|
||||
while ps -p $pid >/dev/null; do
|
||||
printf " [%c] " "$spinstr"
|
||||
spinstr=${spinstr#?}${spinstr%"${spinstr#?}"}
|
||||
sleep $delay
|
||||
@@ -59,15 +59,15 @@ while read -r container; do
|
||||
container_status=$(echo $container | awk '{print $3}')
|
||||
formatted_line=$(printf "$FORMAT" "$container_name" "$container_status")
|
||||
menu_items+=("$container_id" "$formatted_line" "OFF")
|
||||
done <<< "$containers"
|
||||
done <<<"$containers"
|
||||
|
||||
CHOICES=$(whiptail --title "LXC Container Delete" \
|
||||
--checklist "Select LXC containers to delete:" 25 60 13 \
|
||||
"${menu_items[@]}" 3>&2 2>&1 1>&3)
|
||||
--checklist "Select LXC containers to delete:" 25 60 13 \
|
||||
"${menu_items[@]}" 3>&2 2>&1 1>&3)
|
||||
|
||||
if [ -z "$CHOICES" ]; then
|
||||
whiptail --title "LXC Container Delete" \
|
||||
--msgbox "No containers selected!" 10 60
|
||||
--msgbox "No containers selected!" 10 60
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -44,23 +44,35 @@ intel() {
|
||||
fi
|
||||
|
||||
intel_microcode=$(curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode//" | grep -o 'href="[^"]*amd64.deb"' | sed 's/href="//;s/"//')
|
||||
[ -z "$intel_microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Found" --msgbox "It appears there were no microcode packages found\n Try again later." 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
[ -z "$intel_microcode" ] && {
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Found" --msgbox "It appears there were no microcode packages found\n Try again later." 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
msg_ok "Done"
|
||||
exit
|
||||
}
|
||||
|
||||
MICROCODE_MENU=()
|
||||
MSG_MAX_LENGTH=0
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
(( ${#ITEM} + OFFSET > MSG_MAX_LENGTH )) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
MICROCODE_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(echo "$intel_microcode")
|
||||
|
||||
microcode=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current Microcode revision:${current_microcode}" --radiolist "\nSelect a microcode package to install:\n" 16 $((MSG_MAX_LENGTH + 58)) 6 "${MICROCODE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
[ -z "$microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Selected" --msgbox "It appears that no microcode packages were selected" 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
[ -z "$microcode" ] && {
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Selected" --msgbox "It appears that no microcode packages were selected" 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
msg_ok "Done"
|
||||
exit
|
||||
}
|
||||
|
||||
msg_info "Downloading the Intel Processor Microcode Package $microcode"
|
||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode
|
||||
curl -fsSL "http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode" -O $(basename "http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode")
|
||||
msg_ok "Downloaded the Intel Processor Microcode Package $microcode"
|
||||
|
||||
msg_info "Installing $microcode (Patience)"
|
||||
@@ -76,23 +88,35 @@ intel() {
|
||||
amd() {
|
||||
amd_microcode=$(curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode///" | grep -o 'href="[^"]*amd64.deb"' | sed 's/href="//;s/"//')
|
||||
|
||||
[ -z "$amd_microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Found" --msgbox "It appears there were no microcode packages found\n Try again later." 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
[ -z "$amd_microcode" ] && {
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Found" --msgbox "It appears there were no microcode packages found\n Try again later." 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
msg_ok "Done"
|
||||
exit
|
||||
}
|
||||
|
||||
MICROCODE_MENU=()
|
||||
MSG_MAX_LENGTH=0
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
(( ${#ITEM} + OFFSET > MSG_MAX_LENGTH )) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
MICROCODE_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(echo "$amd_microcode")
|
||||
|
||||
microcode=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current Microcode revision:${current_microcode}" --radiolist "\nSelect a microcode package to install:\n" 16 $((MSG_MAX_LENGTH + 58)) 6 "${MICROCODE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
[ -z "$microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Selected" --msgbox "It appears that no microcode packages were selected" 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
[ -z "$microcode" ] && {
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Selected" --msgbox "It appears that no microcode packages were selected" 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
msg_ok "Done"
|
||||
exit
|
||||
}
|
||||
|
||||
msg_info "Downloading the AMD Processor Microcode Package $microcode"
|
||||
wget -q https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode
|
||||
curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode" -O $(basename "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode")
|
||||
msg_ok "Downloaded the AMD Processor Microcode Package $microcode"
|
||||
|
||||
msg_info "Installing $microcode (Patience)"
|
||||
@@ -105,7 +129,11 @@ amd() {
|
||||
echo -e "\nIn order to apply the changes, a system reboot will be necessary.\n"
|
||||
}
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1; then header_info; msg_error "No PVE Detected!"; exit; fi
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
header_info
|
||||
msg_error "No PVE Detected!"
|
||||
exit
|
||||
fi
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE Processor Microcode" --yesno "This will check for CPU microcode packages with the option to install. Proceed?" 10 58 || exit
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@ cat <<"EOF"
|
||||
EOF
|
||||
|
||||
add() {
|
||||
while true; do
|
||||
read -p "This script will add Monitor All to Proxmox VE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
while true; do
|
||||
read -p "This script will add Monitor All to Proxmox VE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo '#!/usr/bin/env bash
|
||||
echo '#!/usr/bin/env bash
|
||||
# Read excluded instances from command line arguments
|
||||
excluded_instances=("$@")
|
||||
echo "Excluded instances: ${excluded_instances[@]}"
|
||||
@@ -89,10 +89,10 @@ while true; do
|
||||
echo "$(date): Pausing for 5 minutes..."
|
||||
sleep 300
|
||||
done >/var/log/ping-instances.log 2>&1' >/usr/local/bin/ping-instances.sh
|
||||
touch /var/log/ping-instances.log
|
||||
# Change file permissions to executable
|
||||
chmod +x /usr/local/bin/ping-instances.sh
|
||||
cat <<EOF >/etc/systemd/system/ping-instances.timer
|
||||
touch /var/log/ping-instances.log
|
||||
# Change file permissions to executable
|
||||
chmod +x /usr/local/bin/ping-instances.sh
|
||||
cat <<EOF >/etc/systemd/system/ping-instances.timer
|
||||
[Unit]
|
||||
Description=Delay ping-instances.service by 5 minutes
|
||||
|
||||
@@ -104,8 +104,8 @@ OnUnitActiveSec=300
|
||||
WantedBy=timers.target
|
||||
EOF
|
||||
|
||||
# Create ping-instances.service
|
||||
cat <<EOF >/etc/systemd/system/ping-instances.service
|
||||
# Create ping-instances.service
|
||||
cat <<EOF >/etc/systemd/system/ping-instances.service
|
||||
[Unit]
|
||||
Description=Ping instances every 5 minutes and restarts if necessary
|
||||
After=ping-instances.timer
|
||||
@@ -125,12 +125,12 @@ StandardError=file:/var/log/ping-instances.log
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Reload daemon, enable and start ping-instances.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now ping-instances.timer
|
||||
systemctl enable -q --now ping-instances.service
|
||||
clear
|
||||
echo -e "\n To view Monitor All logs: cat /var/log/ping-instances.log"
|
||||
# Reload daemon, enable and start ping-instances.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now ping-instances.timer
|
||||
systemctl enable -q --now ping-instances.service
|
||||
clear
|
||||
echo -e "\n To view Monitor All logs: cat /var/log/ping-instances.log"
|
||||
}
|
||||
|
||||
remove() {
|
||||
@@ -141,23 +141,23 @@ remove() {
|
||||
}
|
||||
|
||||
# Define options for the whiptail menu
|
||||
OPTIONS=(Add "Add Monitor-All to Proxmox VE" \
|
||||
Remove "Remove Monitor-All from Proxmox VE")
|
||||
OPTIONS=(Add "Add Monitor-All to Proxmox VE"
|
||||
Remove "Remove Monitor-All from Proxmox VE")
|
||||
|
||||
# Show the whiptail menu and save the user's choice
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Monitor-All for Proxmox VE" --menu "Select an option:" 10 58 2 \
|
||||
"${OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
"${OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
# Check the user's choice and perform the corresponding action
|
||||
case $CHOICE in
|
||||
"Add")
|
||||
add
|
||||
;;
|
||||
"Remove")
|
||||
remove
|
||||
;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
"Add")
|
||||
add
|
||||
;;
|
||||
"Remove")
|
||||
remove
|
||||
;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
_ __ __ ____ __
|
||||
/ | / /__ / /_/ __ \____ _/ /_____ _
|
||||
/ |/ / _ \/ __/ / / / __ `/ __/ __ `/
|
||||
@@ -52,15 +52,15 @@ install() {
|
||||
header_info
|
||||
read -r -p "Verbose mode? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
STD=""
|
||||
STD=""
|
||||
else
|
||||
STD="silent"
|
||||
STD="silent"
|
||||
fi
|
||||
header_info
|
||||
|
||||
msg_info "Setting up repository"
|
||||
$STD apt-get install -y debian-keyring
|
||||
wget -q https://repo.netdata.cloud/repos/repoconfig/debian/bookworm/netdata-repo_5-1+debian12_all.deb
|
||||
curl -fsSL "https://repo.netdata.cloud/repos/repoconfig/debian/bookworm/netdata-repo_5-1+debian12_all.deb" -O $(basename "https://repo.netdata.cloud/repos/repoconfig/debian/bookworm/netdata-repo_5-1+debian12_all.deb")
|
||||
$STD dpkg -i netdata-repo_5-1+debian12_all.deb
|
||||
rm -rf netdata-repo_5-1+debian12_all.deb
|
||||
msg_ok "Set up repository"
|
||||
@@ -77,9 +77,9 @@ uninstall() {
|
||||
header_info
|
||||
read -r -p "Verbose mode? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
STD=""
|
||||
STD=""
|
||||
else
|
||||
STD="silent"
|
||||
STD="silent"
|
||||
fi
|
||||
header_info
|
||||
|
||||
@@ -103,21 +103,21 @@ if ! pveversion | grep -Eq "pve-manager/(8\.[0-9])"; then
|
||||
exit
|
||||
fi
|
||||
|
||||
OPTIONS=(Install "Install NetData on Proxmox VE" \
|
||||
Uninstall "Uninstall NetData from Proxmox VE")
|
||||
OPTIONS=(Install "Install NetData on Proxmox VE"
|
||||
Uninstall "Uninstall NetData from Proxmox VE")
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "NetData" --menu "Select an option:" 10 58 2 \
|
||||
"${OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
"${OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
case $CHOICE in
|
||||
"Install")
|
||||
install
|
||||
;;
|
||||
"Uninstall")
|
||||
uninstall
|
||||
;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
"Install")
|
||||
install
|
||||
;;
|
||||
"Uninstall")
|
||||
uninstall
|
||||
;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ ___ _______
|
||||
/ __ \/ (_) _____/_ __(_)___
|
||||
/ / / / / / | / / _ \/ / / / __ \
|
||||
@@ -31,12 +31,12 @@ set-e
|
||||
header_info
|
||||
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
header_info
|
||||
|
||||
@@ -51,7 +51,7 @@ function msg_ok() {
|
||||
}
|
||||
|
||||
msg_info "Installing ${APP}"
|
||||
wget -q https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.deb
|
||||
curl -fsSL "https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.deb" -O $(basename "https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.deb")
|
||||
dpkg -i OliveTin_linux_amd64.deb &>/dev/null
|
||||
systemctl enable --now OliveTin &>/dev/null
|
||||
rm OliveTin_linux_amd64.deb
|
||||
|
||||
@@ -44,7 +44,6 @@ msg_error() {
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
|
||||
start_routines() {
|
||||
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 \
|
||||
@@ -164,7 +163,10 @@ while true; do
|
||||
read -p "Start the Update to Proxmox Backup Server 3 Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) clear; exit ;;
|
||||
[Nn]*)
|
||||
clear
|
||||
exit
|
||||
;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -39,8 +39,8 @@ header_info
|
||||
# Check if running on bare metal using systemd-detect-virt.
|
||||
virt=$(systemd-detect-virt)
|
||||
if [ "$virt" != "none" ]; then
|
||||
msg_error "This script must be run on bare metal. Detected virtual environment: $virt"
|
||||
exit 1
|
||||
msg_error "This script must be run on bare metal. Detected virtual environment: $virt"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Attempt to obtain the current loaded microcode revision
|
||||
@@ -58,7 +58,7 @@ intel() {
|
||||
fi
|
||||
|
||||
intel_microcode=$(curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/" | grep -o 'href="[^"]*amd64.deb"' | sed 's/href="//;s/"//')
|
||||
[ -z "$intel_microcode" ] && {
|
||||
[ -z "$intel_microcode" ] && {
|
||||
whiptail --backtitle "Proxmox Backup Server Helper Scripts" --title "No Microcode Found" --msgbox "No microcode packages were found.\nTry again later." 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
@@ -71,7 +71,7 @@ intel() {
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
(( ${#ITEM} + OFFSET > MSG_MAX_LENGTH )) && MSG_MAX_LENGTH=$(( ${#ITEM} + OFFSET ))
|
||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET))
|
||||
MICROCODE_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(echo "$intel_microcode")
|
||||
|
||||
@@ -80,7 +80,7 @@ intel() {
|
||||
--radiolist "\nSelect a microcode package to install:\n" \
|
||||
16 $((MSG_MAX_LENGTH + 58)) 6 "${MICROCODE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
[ -z "$microcode" ] && {
|
||||
[ -z "$microcode" ] && {
|
||||
whiptail --backtitle "Proxmox Backup Server Helper Scripts" --title "No Microcode Selected" --msgbox "No microcode package was selected." 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
@@ -89,7 +89,7 @@ intel() {
|
||||
}
|
||||
|
||||
msg_info "Downloading Intel processor microcode package $microcode"
|
||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode
|
||||
curl -fsSL "http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode" -O $(basename "http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode")
|
||||
msg_ok "Downloaded Intel processor microcode package $microcode"
|
||||
|
||||
msg_info "Installing $microcode (this might take a while)"
|
||||
@@ -105,7 +105,7 @@ intel() {
|
||||
amd() {
|
||||
amd_microcode=$(curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/" | grep -o 'href="[^"]*amd64.deb"' | sed 's/href="//;s/"//')
|
||||
|
||||
[ -z "$amd_microcode" ] && {
|
||||
[ -z "$amd_microcode" ] && {
|
||||
whiptail --backtitle "Proxmox Backup Server Helper Scripts" --title "No Microcode Found" --msgbox "No microcode packages were found.\nTry again later." 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
@@ -118,7 +118,7 @@ amd() {
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
(( ${#ITEM} + OFFSET > MSG_MAX_LENGTH )) && MSG_MAX_LENGTH=$(( ${#ITEM} + OFFSET ))
|
||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET))
|
||||
MICROCODE_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(echo "$amd_microcode")
|
||||
|
||||
@@ -127,7 +127,7 @@ amd() {
|
||||
--radiolist "\nSelect a microcode package to install:\n" \
|
||||
16 $((MSG_MAX_LENGTH + 58)) 6 "${MICROCODE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
[ -z "$microcode" ] && {
|
||||
[ -z "$microcode" ] && {
|
||||
whiptail --backtitle "Proxmox Backup Server Helper Scripts" --title "No Microcode Selected" --msgbox "No microcode package was selected." 10 68
|
||||
msg_info "Exiting"
|
||||
sleep 1
|
||||
@@ -136,7 +136,7 @@ amd() {
|
||||
}
|
||||
|
||||
msg_info "Downloading AMD processor microcode package $microcode"
|
||||
wget -q https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode
|
||||
curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode" -O $(basename "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode")
|
||||
msg_ok "Downloaded AMD processor microcode package $microcode"
|
||||
|
||||
msg_info "Installing $microcode (this might take a while)"
|
||||
|
||||
@@ -44,7 +44,6 @@ msg_error() {
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
|
||||
start_routines() {
|
||||
header_info
|
||||
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
||||
@@ -171,14 +170,17 @@ while true; do
|
||||
read -p "Start the Proxmox Backup Server Post Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) clear; exit ;;
|
||||
[Nn]*)
|
||||
clear
|
||||
exit
|
||||
;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "\n🛑 PVE Detected, Wrong Script!\n"
|
||||
exit 1
|
||||
echo -e "\n🛑 PVE Detected, Wrong Script!\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start_routines
|
||||
|
||||
@@ -172,7 +172,10 @@ while true; do
|
||||
read -p "Start the Proxmox Mail Gateway Post Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) clear; exit ;;
|
||||
[Nn]*)
|
||||
clear
|
||||
exit
|
||||
;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -58,7 +58,7 @@ deb http://deb.debian.org/debian bookworm main contrib
|
||||
deb http://deb.debian.org/debian bookworm-updates main contrib
|
||||
deb http://security.debian.org/debian-security bookworm-security main contrib
|
||||
EOF
|
||||
echo 'APT::Get::Update::SourceListWarnings::NonFreeFirmware "false";' >/etc/apt/apt.conf.d/no-bookworm-firmware.conf
|
||||
echo 'APT::Get::Update::SourceListWarnings::NonFreeFirmware "false";' >/etc/apt/apt.conf.d/no-bookworm-firmware.conf
|
||||
msg_ok "Corrected Proxmox VE Sources"
|
||||
;;
|
||||
no)
|
||||
@@ -98,24 +98,24 @@ EOF
|
||||
;;
|
||||
esac
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CEPH PACKAGE REPOSITORIES" --menu "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories (initially disabled).\n \nCorrect 'ceph package sources?" 14 58 2 \
|
||||
"yes" " " \
|
||||
"no" " " 3>&2 2>&1 1>&3)
|
||||
case $CHOICE in
|
||||
yes)
|
||||
msg_info "Correcting 'ceph package repositories'"
|
||||
cat <<EOF >/etc/apt/sources.list.d/ceph.list
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CEPH PACKAGE REPOSITORIES" --menu "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories (initially disabled).\n \nCorrect 'ceph package sources?" 14 58 2 \
|
||||
"yes" " " \
|
||||
"no" " " 3>&2 2>&1 1>&3)
|
||||
case $CHOICE in
|
||||
yes)
|
||||
msg_info "Correcting 'ceph package repositories'"
|
||||
cat <<EOF >/etc/apt/sources.list.d/ceph.list
|
||||
# deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise
|
||||
# deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription
|
||||
# deb https://enterprise.proxmox.com/debian/ceph-reef bookworm enterprise
|
||||
# deb http://download.proxmox.com/debian/ceph-reef bookworm no-subscription
|
||||
EOF
|
||||
msg_ok "Corrected 'ceph package repositories'"
|
||||
;;
|
||||
no)
|
||||
msg_error "Selected no to Correcting 'ceph package repositories'"
|
||||
;;
|
||||
esac
|
||||
msg_ok "Corrected 'ceph package repositories'"
|
||||
;;
|
||||
no)
|
||||
msg_error "Selected no to Correcting 'ceph package repositories'"
|
||||
;;
|
||||
esac
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVETEST" --menu "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released.\n \nAdd (Disabled) 'pvetest' repository?" 14 58 2 \
|
||||
"yes" " " \
|
||||
@@ -141,7 +141,7 @@ EOF
|
||||
yes)
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Support Subscriptions" "Supporting the software's development team is essential. Check their official website's Support Subscriptions for pricing. Without their dedicated work, we wouldn't have this exceptional software." 10 58
|
||||
msg_info "Disabling subscription nag"
|
||||
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/.*data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
|
||||
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/.*data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
|
||||
apt --reinstall install proxmox-widget-toolkit &>/dev/null
|
||||
msg_ok "Disabled subscription nag (Delete browser cache)"
|
||||
;;
|
||||
@@ -169,7 +169,7 @@ EOF
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
if systemctl is-active --quiet pve-ha-lrm; then
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "HIGH AVAILABILITY" --menu "If you plan to utilize a single node instead of a clustered environment, you can disable unnecessary high availability (HA) services, thus reclaiming system resources.\n\nIf HA becomes necessary at a later stage, the services can be re-enabled.\n\nDisable high availability?" 18 58 2 \
|
||||
"yes" " " \
|
||||
@@ -187,7 +187,7 @@ EOF
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE" --menu "\nUpdate Proxmox VE now?" 11 58 2 \
|
||||
"yes" " " \
|
||||
"no" " " 3>&2 2>&1 1>&3)
|
||||
@@ -226,7 +226,10 @@ while true; do
|
||||
read -p "Start the Proxmox VE Post Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) clear; exit ;;
|
||||
[Nn]*)
|
||||
clear
|
||||
exit
|
||||
;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -48,48 +48,48 @@ start_routines() {
|
||||
header_info
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8 SOURCES" "This will set the correct sources to update and install Proxmox VE 8." 10 58
|
||||
msg_info "Changing to Proxmox VE 8 Sources"
|
||||
cat <<EOF >/etc/apt/sources.list
|
||||
msg_info "Changing to Proxmox VE 8 Sources"
|
||||
cat <<EOF >/etc/apt/sources.list
|
||||
deb http://ftp.debian.org/debian bookworm main contrib
|
||||
deb http://ftp.debian.org/debian bookworm-updates main contrib
|
||||
deb http://security.debian.org/debian-security bookworm-security main contrib
|
||||
EOF
|
||||
msg_ok "Changed to Proxmox VE 8 Sources"
|
||||
msg_ok "Changed to Proxmox VE 8 Sources"
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8-ENTERPRISE" "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription." 10 58
|
||||
msg_info "Disabling 'pve-enterprise' repository"
|
||||
cat <<EOF >/etc/apt/sources.list.d/pve-enterprise.list
|
||||
msg_info "Disabling 'pve-enterprise' repository"
|
||||
cat <<EOF >/etc/apt/sources.list.d/pve-enterprise.list
|
||||
# deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise
|
||||
EOF
|
||||
msg_ok "Disabled 'pve-enterprise' repository"
|
||||
msg_ok "Disabled 'pve-enterprise' repository"
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8-NO-SUBSCRIPTION" "The 'pve-no-subscription' repository provides access to all of the open-source components of Proxmox VE." 10 58
|
||||
msg_info "Enabling 'pve-no-subscription' repository"
|
||||
cat <<EOF >/etc/apt/sources.list.d/pve-install-repo.list
|
||||
msg_info "Enabling 'pve-no-subscription' repository"
|
||||
cat <<EOF >/etc/apt/sources.list.d/pve-install-repo.list
|
||||
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
|
||||
EOF
|
||||
msg_ok "Enabled 'pve-no-subscription' repository"
|
||||
msg_ok "Enabled 'pve-no-subscription' repository"
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8 CEPH PACKAGE REPOSITORIES" "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories." 10 58
|
||||
msg_info "Enabling 'ceph package repositories'"
|
||||
cat <<EOF >/etc/apt/sources.list.d/ceph.list
|
||||
msg_info "Enabling 'ceph package repositories'"
|
||||
cat <<EOF >/etc/apt/sources.list.d/ceph.list
|
||||
# deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise
|
||||
deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription
|
||||
EOF
|
||||
msg_ok "Enabled 'ceph package repositories'"
|
||||
msg_ok "Enabled 'ceph package repositories'"
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8 TEST" "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released (Disabled)." 10 58
|
||||
msg_info "Adding 'pvetest' repository and set disabled"
|
||||
cat <<EOF >/etc/apt/sources.list.d/pvetest-for-beta.list
|
||||
msg_info "Adding 'pvetest' repository and set disabled"
|
||||
cat <<EOF >/etc/apt/sources.list.d/pvetest-for-beta.list
|
||||
# deb http://download.proxmox.com/debian/pve bookworm pvetest
|
||||
EOF
|
||||
msg_ok "Added 'pvetest' repository"
|
||||
msg_ok "Added 'pvetest' repository"
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8 UPDATE" "Updating to Proxmox VE 8" 10 58
|
||||
msg_info "Updating to Proxmox VE 8 (Patience)"
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y
|
||||
msg_ok "Updated to Proxmox VE 8"
|
||||
msg_info "Updating to Proxmox VE 8 (Patience)"
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y
|
||||
msg_ok "Updated to Proxmox VE 8"
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "REBOOT" --menu "\nReboot Proxmox VE 8 now? (recommended)" 11 58 2 \
|
||||
"yes" " " \
|
||||
@@ -113,7 +113,10 @@ while true; do
|
||||
read -p "Start the Update to Proxmox VE 8 Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) clear; exit ;;
|
||||
[Nn]*)
|
||||
clear
|
||||
exit
|
||||
;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -28,7 +28,10 @@ function msg_error() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
if command -v pveversion >/dev/null 2>&1; then msg_error "Can't Install on Proxmox "; exit; fi
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
msg_error "Can't Install on Proxmox "
|
||||
exit
|
||||
fi
|
||||
msg_info "Installing pyenv"
|
||||
apt-get install -y \
|
||||
make \
|
||||
@@ -58,9 +61,9 @@ apt-get install -y \
|
||||
|
||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv &>/dev/null
|
||||
set +e
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
||||
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init --path)"\nfi' >> ~/.bashrc
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >>~/.bashrc
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >>~/.bashrc
|
||||
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init --path)"\nfi' >>~/.bashrc
|
||||
msg_ok "Installed pyenv"
|
||||
. ~/.bashrc
|
||||
set -e
|
||||
@@ -70,8 +73,8 @@ pyenv global 3.11.1
|
||||
msg_ok "Installed Python 3.11.1"
|
||||
read -r -p "Would you like to install Home Assistant Beta? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Home Assistant Beta"
|
||||
cat <<EOF >/etc/systemd/system/homeassistant.service
|
||||
msg_info "Installing Home Assistant Beta"
|
||||
cat <<EOF >/etc/systemd/system/homeassistant.service
|
||||
[Unit]
|
||||
Description=Home Assistant
|
||||
After=network-online.target
|
||||
@@ -83,31 +86,31 @@ RestartForceExitStatus=100
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
mkdir /srv/homeassistant
|
||||
cd /srv/homeassistant
|
||||
python3 -m venv .
|
||||
source bin/activate
|
||||
python3 -m pip install wheel &>/dev/null
|
||||
pip3 install --upgrade pip &>/dev/null
|
||||
pip3 install psycopg2-binary &>/dev/null
|
||||
pip3 install --pre homeassistant &>/dev/null
|
||||
systemctl enable homeassistant &>/dev/null
|
||||
msg_ok "Installed Home Assistant Beta"
|
||||
echo -e " Go to $(hostname -I | awk '{print $1}'):8123"
|
||||
hass
|
||||
mkdir /srv/homeassistant
|
||||
cd /srv/homeassistant
|
||||
python3 -m venv .
|
||||
source bin/activate
|
||||
python3 -m pip install wheel &>/dev/null
|
||||
pip3 install --upgrade pip &>/dev/null
|
||||
pip3 install psycopg2-binary &>/dev/null
|
||||
pip3 install --pre homeassistant &>/dev/null
|
||||
systemctl enable homeassistant &>/dev/null
|
||||
msg_ok "Installed Home Assistant Beta"
|
||||
echo -e " Go to $(hostname -I | awk '{print $1}'):8123"
|
||||
hass
|
||||
fi
|
||||
|
||||
read -r -p "Would you like to install ESPHome Beta? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing ESPHome Beta"
|
||||
mkdir /srv/esphome
|
||||
cd /srv/esphome
|
||||
python3 -m venv .
|
||||
source bin/activate
|
||||
python3 -m pip install wheel &>/dev/null
|
||||
pip3 install --upgrade pip &>/dev/null
|
||||
pip3 install --pre esphome &>/dev/null
|
||||
cat <<EOF >/srv/esphome/start.sh
|
||||
msg_info "Installing ESPHome Beta"
|
||||
mkdir /srv/esphome
|
||||
cd /srv/esphome
|
||||
python3 -m venv .
|
||||
source bin/activate
|
||||
python3 -m pip install wheel &>/dev/null
|
||||
pip3 install --upgrade pip &>/dev/null
|
||||
pip3 install --pre esphome &>/dev/null
|
||||
cat <<EOF >/srv/esphome/start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
@@ -118,8 +121,8 @@ cat <<EOF >/srv/esphome/start.sh
|
||||
source /srv/esphome/bin/activate
|
||||
esphome dashboard /srv/esphome/
|
||||
EOF
|
||||
chmod +x start.sh
|
||||
cat <<EOF >/etc/systemd/system/esphomedashboard.service
|
||||
chmod +x start.sh
|
||||
cat <<EOF >/etc/systemd/system/esphomedashboard.service
|
||||
[Unit]
|
||||
Description=ESPHome Dashboard Service
|
||||
After=network.target
|
||||
@@ -133,27 +136,27 @@ Restart=on-failure
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable --now esphomedashboard &>/dev/null
|
||||
msg_ok "Installed ESPHome Beta"
|
||||
echo -e " Go to $(hostname -I | awk '{print $1}'):6052"
|
||||
exec $SHELL
|
||||
systemctl enable --now esphomedashboard &>/dev/null
|
||||
msg_ok "Installed ESPHome Beta"
|
||||
echo -e " Go to $(hostname -I | awk '{print $1}'):6052"
|
||||
exec $SHELL
|
||||
fi
|
||||
|
||||
read -r -p "Would you like to install Matter-Server (Beta)? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Matter Server"
|
||||
apt-get install -y \
|
||||
libcairo2-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libgirepository1.0-dev \
|
||||
libpango1.0-dev \
|
||||
libgif-dev \
|
||||
g++ &>/dev/null
|
||||
python3 -m pip install wheel
|
||||
pip3 install --upgrade pip
|
||||
pip install python-matter-server[server]
|
||||
msg_ok "Installed Matter Server"
|
||||
echo -e "Start server > python -m matter_server.server"
|
||||
msg_info "Installing Matter Server"
|
||||
apt-get install -y \
|
||||
libcairo2-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libgirepository1.0-dev \
|
||||
libpango1.0-dev \
|
||||
libgif-dev \
|
||||
g++ &>/dev/null
|
||||
python3 -m pip install wheel
|
||||
pip3 install --upgrade pip
|
||||
pip install python-matter-server[server]
|
||||
msg_ok "Installed Matter Server"
|
||||
echo -e "Start server > python -m matter_server.server"
|
||||
fi
|
||||
msg_ok "\nFinished\n"
|
||||
exec $SHELL
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
set -e
|
||||
header_info() {
|
||||
clear
|
||||
cat <<EOF
|
||||
clear
|
||||
cat <<EOF
|
||||
________ __ __ _____
|
||||
/ ___/ _ \/ / / / / ___/__ _ _____ _______ ___ _______
|
||||
/ /__/ ___/ /_/ / / (_ / _ \ |/ / -_) __/ _ \/ _ \/ __(_-<
|
||||
@@ -26,9 +26,9 @@ while read -r TAG ITEM; do
|
||||
done < <(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | tr ' ' '\n' | grep -v "$current_governor")
|
||||
scaling_governor=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current CPU Scaling Governor is set to $current_governor" --checklist "\nSelect the Scaling Governor to use:\n" 16 $((MSG_MAX_LENGTH + 58)) 6 "${GOVERNORS_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
[ -z "$scaling_governor" ] && {
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No CPU Scaling Governor Selected" --msgbox "It appears that no CPU Scaling Governor was selected" 10 68
|
||||
clear
|
||||
exit
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No CPU Scaling Governor Selected" --msgbox "It appears that no CPU Scaling Governor was selected" 10 68
|
||||
clear
|
||||
exit
|
||||
}
|
||||
echo "${scaling_governor}" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null
|
||||
current_governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
|
||||
@@ -38,21 +38,24 @@ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CPU Scaling G
|
||||
"no" " " 3>&2 2>&1 1>&3)
|
||||
|
||||
case $CHOICE in
|
||||
yes)
|
||||
set +e
|
||||
NEW_CRONTAB_COMMAND="(sleep 60 && echo \"$current_governor\" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor)"
|
||||
EXISTING_CRONTAB=$(crontab -l 2>/dev/null)
|
||||
if [[ -n "$EXISTING_CRONTAB" ]]; then
|
||||
TEMP_CRONTAB_FILE=$(mktemp)
|
||||
echo "$EXISTING_CRONTAB" | grep -v "@reboot (sleep 60 && echo*" > "$TEMP_CRONTAB_FILE"
|
||||
crontab "$TEMP_CRONTAB_FILE"
|
||||
rm "$TEMP_CRONTAB_FILE"
|
||||
fi
|
||||
(crontab -l 2>/dev/null; echo "@reboot $NEW_CRONTAB_COMMAND") | crontab -
|
||||
echo -e "\nCrontab Set (use 'crontab -e' to check)"
|
||||
;;
|
||||
no)
|
||||
echo -e "\n\033[31mNOTE: Settings return to default after reboot\033[m\n"
|
||||
;;
|
||||
yes)
|
||||
set +e
|
||||
NEW_CRONTAB_COMMAND="(sleep 60 && echo \"$current_governor\" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor)"
|
||||
EXISTING_CRONTAB=$(crontab -l 2>/dev/null)
|
||||
if [[ -n "$EXISTING_CRONTAB" ]]; then
|
||||
TEMP_CRONTAB_FILE=$(mktemp)
|
||||
echo "$EXISTING_CRONTAB" | grep -v "@reboot (sleep 60 && echo*" >"$TEMP_CRONTAB_FILE"
|
||||
crontab "$TEMP_CRONTAB_FILE"
|
||||
rm "$TEMP_CRONTAB_FILE"
|
||||
fi
|
||||
(
|
||||
crontab -l 2>/dev/null
|
||||
echo "@reboot $NEW_CRONTAB_COMMAND"
|
||||
) | crontab -
|
||||
echo -e "\nCrontab Set (use 'crontab -e' to check)"
|
||||
;;
|
||||
no)
|
||||
echo -e "\n\033[31mNOTE: Settings return to default after reboot\033[m\n"
|
||||
;;
|
||||
esac
|
||||
echo -e "Current CPU Scaling Governor is set to \033[36m$current_governor\033[m\n"
|
||||
|
||||
@@ -38,17 +38,17 @@ done < <(pct list | awk 'NR>1')
|
||||
excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --checklist "\nSelect containers to skip from updates:\n" 16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
function needs_reboot() {
|
||||
local container=$1
|
||||
local os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
||||
local reboot_required_file="/var/run/reboot-required.pkgs"
|
||||
if [ -f "$reboot_required_file" ]; then
|
||||
if [[ "$os" == "ubuntu" || "$os" == "debian" ]]; then
|
||||
if pct exec "$container" -- [ -s "$reboot_required_file" ]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
local container=$1
|
||||
local os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
||||
local reboot_required_file="/var/run/reboot-required.pkgs"
|
||||
if [ -f "$reboot_required_file" ]; then
|
||||
if [[ "$os" == "ubuntu" || "$os" == "debian" ]]; then
|
||||
if pct exec "$container" -- [ -s "$reboot_required_file" ]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
function update_container() {
|
||||
@@ -94,9 +94,9 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
update_container $container
|
||||
fi
|
||||
if pct exec "$container" -- [ -e "/var/run/reboot-required" ]; then
|
||||
# Get the container's hostname and add it to the list
|
||||
container_hostname=$(pct exec "$container" hostname)
|
||||
containers_needing_reboot+=("$container ($container_hostname)")
|
||||
# Get the container's hostname and add it to the list
|
||||
container_hostname=$(pct exec "$container" hostname)
|
||||
containers_needing_reboot+=("$container ($container_hostname)")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -104,9 +104,9 @@ wait
|
||||
header_info
|
||||
echo -e "${GN}The process is complete, and the containers have been successfully updated.${CL}\n"
|
||||
if [ "${#containers_needing_reboot[@]}" -gt 0 ]; then
|
||||
echo -e "${RD}The following containers require a reboot:${CL}"
|
||||
for container_name in "${containers_needing_reboot[@]}"; do
|
||||
echo "$container_name"
|
||||
done
|
||||
echo -e "${RD}The following containers require a reboot:${CL}"
|
||||
for container_name in "${containers_needing_reboot[@]}"; do
|
||||
echo "$container_name"
|
||||
done
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -45,10 +45,10 @@ apt update &>/dev/null
|
||||
apt-get -y install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl unzip shared-mime-info &>/dev/null
|
||||
msg_ok "Installed Prerequisites"
|
||||
|
||||
LATEST=$(curl -sL https://api.github.com/repos/webmin/webmin/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
LATEST=$(curl -fsSLL https://api.github.com/repos/webmin/webmin/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
|
||||
msg_info "Downloading Webmin"
|
||||
wget -q https://github.com/webmin/webmin/releases/download/$LATEST/webmin_${LATEST}_all.deb
|
||||
curl -fsSL "https://github.com/webmin/webmin/releases/download/$LATEST/webmin_${LATEST}_all.deb" -O $(basename "https://github.com/webmin/webmin/releases/download/$LATEST/webmin_${LATEST}_all.deb")
|
||||
msg_ok "Downloaded Webmin"
|
||||
|
||||
msg_info "Installing Webmin"
|
||||
|
||||
Reference in New Issue
Block a user