Patilchitrang

7H SERVER PRO S3

May 2nd, 2022 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. 【H】2【H】
  2.  
  3. local function isVpnUsed()
  4.   import "java.net.NetworkInterface"
  5.   import "java.util.Collections"
  6.   import "java.util.Enumeration"
  7.   import "java.util.Iterator"
  8.   local nlp= NetworkInterface.getNetworkInterfaces();
  9.   if (nlp~=nil) then
  10.     local it = Collections.list(nlp).iterator();
  11.     while (it.hasNext()) do
  12.       local nlo = it.next();
  13.       if (nlo.isUp() && nlo.getInterfaceAddresses().size() ~= 0) then
  14.         if ((tostring(nlo):find("tun0")) or (tostring(nlo):find("ppp0"))) then
  15.           return true
  16.         end
  17.       end
  18.     end
  19.     return false
  20.   end
  21. end
  22.  
  23.  
  24.  
  25. if isVpnUsed() then
  26.       os.exit()
  27.  
  28. end
  29.  
Add Comment
Please, Sign In to add comment