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