refactor(setup-fork): check if count is a number with regex

This commit is contained in:
ethan
2026-04-16 22:57:31 +02:00
parent 7eee4e430c
commit 321631aa2e

View File

@@ -125,7 +125,7 @@ update_links() {
local count=$(grep -c "community-scripts/ProxmoxVED" "$file" 2>/dev/null || echo 0)
# Set to 0 if count is non numeric
if ! [ "$count" -eq "$count" ] 2>/dev/null; then
if ! [[ "$count" =~ ^[0-9]+$ ]]; then
count=0
fi
@@ -146,7 +146,7 @@ update_links() {
local count=$(grep -c "community-scripts/ProxmoxVED" "$file" 2>/dev/null || echo 0)
# Set to 0 if count is non numeric
if ! [ "$count" -eq "$count" ] 2>/dev/null; then
if ! [[ "$count" =~ ^[0-9]+$ ]]; then
count=0
fi