Avoid duplicates
This commit is contained in:
parent
c9ff98c848
commit
939d8f27a1
|
@ -134,10 +134,13 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||
if [ ${state} -eq "1" ]; then
|
||||
if [[ $line == *"address ="* ]]; then
|
||||
address=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}')
|
||||
echo " http://$peer:$TRACKER_PORT/announce" >> $ZERONET_CONFIG.new
|
||||
state=0
|
||||
tracker_url="http://$peer:$TRACKER_PORT/announce"
|
||||
if ! grep -q "$tracker_url" $ZERONET_CONFIG.new; then
|
||||
echo " $tracker_url" >> $ZERONET_CONFIG.new
|
||||
tracker_ctr=$((tracker_ctr + 1))
|
||||
fi
|
||||
state=0
|
||||
fi
|
||||
fi
|
||||
if [[ $line == *"hostname ="* ]]; then
|
||||
peer=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}')
|
||||
|
|
Loading…
Reference in New Issue