Fix check_lists in ppa.sh

This commit is contained in:
Shivam Mathur
2025-11-26 20:43:34 +05:30
parent 9d7558f1af
commit d590042285

View File

@ -246,7 +246,11 @@ check_lists() {
match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1) match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1)
fi fi
if [ -z "$match_file" ] && [ -n "$secondary" ]; then if [ -z "$match_file" ] && [ -n "$secondary" ]; then
match_file=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1) local candidate
candidate=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1)
if [ -n "$candidate" ] && { [ -z "$primary" ] || grep -Eq "$primary" "$candidate"; }; then
match_file="$candidate"
fi
fi fi
if [ -n "$match_file" ]; then if [ -n "$match_file" ]; then
local list_count local list_count