Commit 48c9218 1 parent 3605356 commit 48c9218 Copy full SHA for 48c9218
File tree 1 file changed +1
-8
lines changed
1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -550,20 +550,13 @@ function test_availability ()
550
550
fi
551
551
cd /opt/4nonimizer/vpn/$lista
552
552
dos2unix * & > /dev/null
553
- for file in $( ls * .ovpn)
553
+ for file in $( ls * .ovpn 2> /dev/null )
554
554
do
555
555
checkedprotocol=$( grep -v ' #' $file | grep -m 1 proto | awk ' {print $2}' )
556
556
checkedip=$( grep -v ' #' $file | grep -m 1 remote | awk ' {print $2}' )
557
557
checkedport=$( grep -v ' #' $file | grep -m 1 remote | awk ' {print $3}' )
558
558
if [[ $checkedprotocol = * " tcp" * ]]
559
559
then
560
- # option 1
561
- # result=$(nc -zv -w3 $checkedip $checkedport 2>&1 | grep succeeded);
562
- # if [ -n "$result" ]; then
563
- # option 2
564
- # </dev/tcp/$checkedip/$checkedport
565
- # if [ "$?" -ne 0 ]; then
566
- # option 3
567
560
open=` nmap --version-light --min-rate 10000 -p $checkedport $checkedip | grep " $checkedport " | grep open`
568
561
if [ -z " $open " ]; then
569
562
echo " OK! The peer $checkedip in port $checkedport /$checkedprotocol is NOT available. The $file will be deleted."
You can’t perform that action at this time.
0 commit comments