mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-03 11:33:05 +02:00
fix headers
This commit is contained in:
+3
-1
@@ -24,7 +24,9 @@ generate_headers() {
|
||||
|
||||
app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null)
|
||||
if [[ -n "$app_name" ]]; then
|
||||
output_file="${headers_dir}/$(basename "${script%.*}")"
|
||||
# core.func/vm-core.func look the header up as "${APP,,}" without spaces,
|
||||
# so the generated file has to be named after APP - not after the script.
|
||||
output_file="${headers_dir}/$(echo "${app_name,,}" | tr -d ' ')"
|
||||
figlet_output=$(figlet -w 500 -f slant "$app_name")
|
||||
if [[ -n "$figlet_output" ]]; then
|
||||
echo "$figlet_output" >"$output_file"
|
||||
|
||||
@@ -19,33 +19,21 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-netbird-l
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
_ __ __ ____ _ __
|
||||
/ | / /__ / /_/ __ )(_)________/ /
|
||||
/ |/ / _ \/ __/ __ / / ___/ __ /
|
||||
/ /| / __/ /_/ /_/ / / / / /_/ /
|
||||
/_/ |_/\___/\__/_____/_/_/ \__,_/
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
|
||||
header_info
|
||||
|
||||
while true; do
|
||||
read -r -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)?" yn
|
||||
read -r -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)? " yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit 0 ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
header_info
|
||||
msg_info "Loading container list..."
|
||||
|
||||
echo -e "Loading container list..."
|
||||
|
||||
NODE=$(hostname)
|
||||
MSG_MAX_LENGTH=0
|
||||
@@ -88,18 +76,18 @@ cat <<EOF >>"$CTID_CONFIG_PATH"
|
||||
lxc.cgroup2.devices.allow: c 10:200 rwm
|
||||
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
|
||||
EOF
|
||||
header_info
|
||||
|
||||
msg_info "Installing NetBird"
|
||||
pct exec "$CTID" -- bash -c '
|
||||
if ! command -v curl &>/dev/null; then
|
||||
apt-get update -qq
|
||||
apt-get install -y curl >/dev/null
|
||||
apt update -qq
|
||||
apt install -y curl >/dev/null
|
||||
fi
|
||||
apt install -y ca-certificates gpg &>/dev/null
|
||||
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
|
||||
apt update &>/dev/null
|
||||
apt install -y netbird-ui &>/dev/null
|
||||
if systemctl list-unit-files docker.service &>/dev/null; then
|
||||
mkdir -p /etc/systemd/system/netbird.service.d
|
||||
cat <<OVERRIDE >/etc/systemd/system/netbird.service.d/after-docker.conf
|
||||
|
||||
@@ -18,18 +18,6 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-tailscale
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
|
||||
function header_info() {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
______ _ __ __
|
||||
/_ __/___ _(_) /_____________ _/ /__
|
||||
/ / / __ `/ / / ___/ ___/ __ `/ / _ \
|
||||
/ / / /_/ / / (__ ) /__/ /_/ / / __/
|
||||
/_/ \__,_/_/_/____/\___/\__,_/_/\___/
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
|
||||
@@ -49,7 +37,6 @@ while true; do
|
||||
esac
|
||||
done
|
||||
|
||||
header_info
|
||||
msg_info "Loading container list..."
|
||||
|
||||
NODE=$(hostname)
|
||||
@@ -78,7 +65,6 @@ CTID_CONFIG_PATH="/etc/pve/lxc/${CTID}.conf"
|
||||
grep -q "lxc.cgroup2.devices.allow: c 10:200 rwm" "$CTID_CONFIG_PATH" || echo "lxc.cgroup2.devices.allow: c 10:200 rwm" >>"$CTID_CONFIG_PATH"
|
||||
grep -q "lxc.mount.entry: /dev/net/tun" "$CTID_CONFIG_PATH" || echo "lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file" >>"$CTID_CONFIG_PATH"
|
||||
|
||||
header_info
|
||||
msg_info "Installing Tailscale in CT $CTID"
|
||||
|
||||
pct exec "$CTID" -- sh -c '
|
||||
|
||||
@@ -13,17 +13,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
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" "addon"
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
___ ____ ______ __ __
|
||||
/ _ | / / / /_ __/__ __ _ ___ / /__ _/ /____ ___
|
||||
/ __ |/ / / / / / -_) ' \/ _ \/ / _ `/ __/ -_|_-<
|
||||
/_/ |_/_/_/ /_/ \__/_/_/_/ .__/_/\_,_/\__/\__/___/
|
||||
/_/
|
||||
EOF
|
||||
}
|
||||
|
||||
# Enable error handling; destroy any partially-created container before reporting the error
|
||||
set -Eeuo pipefail
|
||||
function _cleanup_on_error() {
|
||||
@@ -172,7 +161,7 @@ function select_storage() {
|
||||
printf $STORAGE
|
||||
fi
|
||||
}
|
||||
header_info
|
||||
|
||||
# Get template storage
|
||||
TEMPLATE_STORAGE=$(select_storage template)
|
||||
msg_info "Using '$TEMPLATE_STORAGE' for template storage."
|
||||
@@ -238,7 +227,6 @@ if [[ -f /etc/systemd/system/ping-instances.service ]]; then
|
||||
fi
|
||||
|
||||
# Success message
|
||||
header_info
|
||||
echo
|
||||
msg_ok "LXC container '$CTID' was successfully created, and its IP address is ${IP}."
|
||||
echo
|
||||
|
||||
@@ -21,18 +21,6 @@ trap 'error_handler' ERR
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
_ __ __ ____ __
|
||||
/ | / /__ / /_/ __ \____ _/ /_____ _
|
||||
/ |/ / _ \/ __/ / / / __ `/ __/ __ `/
|
||||
/ /| / __/ /_/ /_/ / /_/ / /_/ /_/ /
|
||||
/_/ |_/\___/\__/_____/\__,_/\__/\__,_/
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
detect_codename() {
|
||||
source /etc/os-release
|
||||
if [[ "$ID" != "debian" ]]; then
|
||||
@@ -56,7 +44,6 @@ get_latest_repo_pkg() {
|
||||
}
|
||||
|
||||
install() {
|
||||
header_info
|
||||
while true; do
|
||||
read -r -p "Are you sure you want to install ${APP} on Proxmox VE host. Proceed(y/n)? " yn
|
||||
case $yn in
|
||||
@@ -92,8 +79,6 @@ install() {
|
||||
}
|
||||
|
||||
uninstall() {
|
||||
header_info
|
||||
|
||||
msg_info "Uninstalling ${APP}"
|
||||
systemctl stop netdata || true
|
||||
rm -rf /var/log/netdata /var/lib/netdata /var/cache/netdata /etc/netdata/go.d
|
||||
|
||||
@@ -21,17 +21,6 @@ trap 'error_handler' ERR
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
_ __ __ _
|
||||
| | /| / /__ / / __ _ (_)__
|
||||
| |/ |/ / -_) _ \/ ' \/ / _ \
|
||||
|__/|__/\__/_.__/_/_/_/_/_//_/
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
header_info
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} Installer" --yesno "This Will Install ${APP} on this LXC Container. Proceed?" 10 58
|
||||
|
||||
Reference in New Issue
Block a user