update pulse installer

This commit is contained in:
David Schroeder
2026-07-25 20:24:46 -05:00
parent f1ed0bb12d
commit bb44ca81f7
3 changed files with 33 additions and 11 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
action="${1:-}" action="${1:-}"
FOLDER='/opt/idssys/ta-proxmenu' FOLDER='/opt/idssys/ta-proxmenu'
VERS='2026.7.25-48' VERS='2026.7.25-49'
noupdate=' ' noupdate=' '
+21 -10
View File
@@ -152,18 +152,29 @@ TAPM_PULSE_FAIL() {
return 1 return 1
} }
TAPM_PULSE_SET_BRIDGE_FROM_SELECTION() {
local variable="$1"
local selection="${2:-}"
local selected_bridge
[[ "$selection" == bridge:* ]] || return 1
selected_bridge="${selection#bridge:}"
[[ -n "$selected_bridge" ]] || return 1
printf -v "$variable" '%s' "$selected_bridge"
}
TAPM_PULSE_SELECT_BRIDGE() { TAPM_PULSE_SELECT_BRIDGE() {
local variable="$1" local variable="$1"
local bridge default_bridge="${2:-vmbr0}" local bridge_name default_bridge="${2:-vmbr0}"
local default_found=0 local default_found=0
local -a bridges=() local -a bridges=()
local -a labels=() local -a labels=()
local -a values=() local -a values=()
while IFS= read -r bridge; do while IFS= read -r bridge_name; do
[[ -n "$bridge" ]] || continue [[ -n "$bridge_name" ]] || continue
bridges+=("$bridge") bridges+=("$bridge_name")
[[ "$bridge" == "$default_bridge" ]] && default_found=1 [[ "$bridge_name" == "$default_bridge" ]] && default_found=1
done < <( done < <(
{ {
for bridge_path in /sys/class/net/*/bridge; do for bridge_path in /sys/class/net/*/bridge; do
@@ -182,15 +193,15 @@ TAPM_PULSE_SELECT_BRIDGE() {
labels+=("${default_bridge} — default") labels+=("${default_bridge} — default")
values+=("bridge:${default_bridge}") values+=("bridge:${default_bridge}")
fi fi
for bridge in "${bridges[@]}"; do for bridge_name in "${bridges[@]}"; do
[[ $default_found == 1 && "$bridge" == "$default_bridge" ]] && continue [[ $default_found == 1 && "$bridge_name" == "$default_bridge" ]] && continue
labels+=("$bridge") labels+=("$bridge_name")
values+=("bridge:${bridge}") values+=("bridge:${bridge_name}")
done done
SELECT_MENU "Pulse network bridge" labels values SELECT_MENU "Pulse network bridge" labels values
case "$MENU_SELECTION" in case "$MENU_SELECTION" in
bridge:*) printf -v "$variable" '%s' "${MENU_SELECTION#bridge:}";; bridge:*) TAPM_PULSE_SET_BRIDGE_FROM_SELECTION "$variable" "$MENU_SELECTION";;
quit) EXIT1; exit 0;; quit) EXIT1; exit 0;;
*) return 1;; *) return 1;;
esac esac
+11
View File
@@ -15,6 +15,17 @@ assert_equal amd64 "$(TAPM_PULSE_ARCH x86_64)" "x86 architecture mapping"
assert_equal arm64 "$(TAPM_PULSE_ARCH aarch64)" "ARM architecture mapping" assert_equal arm64 "$(TAPM_PULSE_ARCH aarch64)" "ARM architecture mapping"
assert_failure "unsupported Pulse architecture" TAPM_PULSE_ARCH riscv64 assert_failure "unsupported Pulse architecture" TAPM_PULSE_ARCH riscv64
test_bridge_selection_assignment() {
local bridge=''
TAPM_PULSE_SET_BRIDGE_FROM_SELECTION bridge 'bridge:vmbr0' || return 1
assert_equal vmbr0 "$bridge" "selected Pulse bridge assigned to caller"
}
assert_success "Pulse bridge selection assignment" test_bridge_selection_assignment
assert_failure "empty Pulse bridge selection rejected" \
TAPM_PULSE_SET_BRIDGE_FROM_SELECTION selected_bridge 'bridge:'
bootstrap_token='0123456789abcdef0123456789abcdef0123456789abcdef' bootstrap_token='0123456789abcdef0123456789abcdef0123456789abcdef'
bootstrap_output="║ Token: ${bootstrap_token}" bootstrap_output="║ Token: ${bootstrap_token}"
assert_equal "$bootstrap_token" \ assert_equal "$bootstrap_token" \