mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-03 20:03:25 +01:00
iptag: fix syntax error in VM config file parsing (#10598)
* fix(iptag): Fix syntax error in VM config file parsing
The array assignment was using an invalid pipe construct inside the loop:
vmids+=("${conf##*/}" | sed 's/\.conf$//')
This caused a bash syntax error:
syntax error near unexpected token '2'
Fixed by using:
- shopt -s nullglob to handle empty directories gracefully
- Parameter expansion ${filename%.conf} instead of sed pipe
Fixes #10595
* fix(iptag): Fix syntax error in VM config file parsing
The array assignment was using an invalid pipe construct inside the loop:
vmids+=("${conf##*/}" | sed 's/\.conf$//')
This caused a bash syntax error:
syntax error near unexpected token '2'
Fixed by using parameter expansion ${basename%.conf} instead of sed pipe.
Fixes #10595
This commit is contained in:
committed by
GitHub
parent
3f608cd7ea
commit
d432d98723
@@ -842,8 +842,10 @@ update_all_tags() {
|
||||
else
|
||||
# More efficient: direct file listing instead of ls+sed
|
||||
vmids=()
|
||||
for conf in /etc/pve/qemu-server/*.conf 2>/dev/null; do
|
||||
[[ -f "$conf" ]] && vmids+=("${conf##*/}" | sed 's/\.conf$//')
|
||||
for conf in /etc/pve/qemu-server/*.conf; do
|
||||
[[ -f "$conf" ]] || continue
|
||||
local basename="${conf##*/}"
|
||||
vmids+=("${basename%.conf}")
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user