Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,14 @@ getDNS() {
# $2 = active dns list
# $! = Separated string of dns config elements
parseDNSLine() {
IFS=':' read -r -a ARRAY <<< "$1"
if [[ "${ARRAY[0]}" =~ ^# ]] || [ "${ARRAY[0]}" == "" ] || [ "${ARRAY[1]}" == "" ]; then
if echo "$1" | grep -Eq '^[^#]+:.+'; then
local ID=$(trim "${1%%:*}")
local DNS=$(echo "${1#*:}" | sed 's/ //g' | sed 's/,/ \/ /g')
local ICON=$ICON_DNS
else
return
fi

local ID=$(trim "${ARRAY[0]}")
local DNS=$(echo "${ARRAY[1]}" | sed 's/ //g' | sed 's/,/ \/ /g')
local ICON=$ICON_DNS

if [ "$DNS" == "$2" ]; then
ICON=$ICON_DNS_USED
ID="$ID (used)"
Expand Down