#!/bin/bash
res="no"
for table in nordvpn.it nordvpn.us rain ; do
   check=`ip rule show lookup $table | grep $1`
   if [ x"$check" != x"" ] ; then
      if [ x"$res" == x"no" ] ; then
         res=$table
      fi
   fi
done
if [ x"$res" == x"no" ] ; then
   check=`ipset list tor_ip | grep $1`
   if [ x"$check" != x"" ] ; then
      res="tor"
   fi
fi
if [ x"$res" == x"no" ] ; then
   check=`ipset list block_ip | grep $1`
   if [ x"$check" != x"" ] ; then
      res="block"
   fi
fi



if [ x"$res" == x"nordvpn.it" ] ; then
   echo it
elif [ x"$res" == x"nordvpn.us" ] ; then
   echo "us"
else
   echo $res
fi
