Godleydemon

Athena Hotspot

Aug 25th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.24 KB | None | 0 0
  1. @echo off
  2.  
  3. title Athena Network Monitor
  4.  
  5. color 0A
  6.  
  7.  
  8.  
  9.  ::Set your ssid/password here
  10.  
  11. set ssid=Athena
  12.  
  13. set password=Midgard123
  14.  
  15.  
  16.  
  17.  :: is the wlan compatible?
  18.  
  19.  
  20.  
  21. if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt" (
  22.  
  23. netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  24.  
  25. timeout /t 2 >nul
  26.  
  27. ) else (
  28.  
  29. type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  30.  
  31. timeout /t 2 >nul
  32.  
  33. netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  34.  
  35. )
  36.  
  37.  
  38.  
  39.  
  40.  
  41. for /f "delims=: tokens=2" %%c in ('findstr /c:"Hosted network supported" %HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt') do set "compatible=%%c"
  42.  
  43.  
  44.  
  45. if %compatible%=="no" (
  46.  
  47. Echo Your Wlan is not compatible with Athena
  48.  
  49. del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
  50.  
  51. PAUSE
  52.  
  53. ) else (
  54.  
  55. Echo Starting...
  56.  
  57. del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
  58.  
  59. )
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  :: Beginning of loop
  66.  
  67. :top
  68.  
  69.  
  70.  
  71.  :: Detect whether clients.txt exists or not
  72.  
  73. if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt" (
  74.  
  75. netsh wlan show hostednetwork >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
  76.  
  77. ) else (
  78.  
  79. type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
  80.  
  81. )
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  :: assign status to a variable
  88.  
  89. for /f "delims=: tokens=2" %%t in ('findstr /c:"Status" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "started=%%t"
  90.  
  91.  
  92.  
  93.  :: assign max clients to a variable
  94.  
  95. for /f "delims=: tokens=2" %%m in ('findstr /c:"Max number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "maxclients=%%m"
  96.  
  97.  
  98.  
  99.  :: assign authentication to a variable
  100.  
  101. for /f "delims=: tokens=2" %%l in ('findstr /c:"Authentication" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "authmode=%%l"
  102.  
  103.  
  104.  
  105.  :: Get Sent Bytes
  106.  
  107. for /f "tokens=3" %%a in ('netstat -e ^| findstr /i bytes') do set "sent=%%a"
  108.  
  109.  
  110.  
  111.  :: Get Received Bytes
  112.  
  113. for /f "tokens=2" %%a in ('netstat -e ^| findstr /i bytes') do set "rec=%%a"
  114.  
  115.  
  116.  
  117.  :: Shorten to KB accuracy to avoid batch math error
  118.  
  119. set sentkb=%sent:~0,-3%
  120.  
  121. set reckb=%rec:~0,-3%
  122.  
  123.  
  124.  
  125.  :: Do some math
  126.  
  127. set /a sentMB = %sentkb% / 1000
  128.  
  129. set /a recMB = %reckb% / 1000
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  :: Set our client variable
  136.  
  137. for /f "delims=" %%a in ('FINDSTR c:"Number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "clients=%%a"
  138.  
  139.  
  140.  
  141.  :: I'm pretty part
  142.  
  143. cls
  144.  
  145. Echo ===============================================================================
  146.  
  147. Echo                             Athena Network Monitor
  148.  
  149. Echo.
  150.  
  151. Echo     SSID: %ssid%
  152.  
  153. Echo    %authmode%: %password%
  154.  
  155. Echo     Status: %started%
  156.  
  157. Echo.
  158.  
  159. Echo ===============================================================================
  160.  
  161. Echo        Bytes Used
  162.  
  163. Echo ===============================================================================
  164.  
  165. Echo     %sentMB% MB Uploaded - %recMB% MB Downloaded
  166.  
  167. Echo.
  168.  
  169. Echo ===============================================================================
  170.  
  171. Echo        Clients Connected
  172.  
  173. Echo ===============================================================================
  174.  
  175. Echo %clients% /%maxclients%
  176.  
  177. timeout /t 2 >nul
  178.  
  179. if %started%=="Not Started" (
  180.  
  181. netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%password% keyUsage=persistent
  182.  
  183. timeout /t 2 >nul
  184.  
  185. netsh wlan start hostednetwork
  186.  
  187. timeout /t 2 >nul
  188.  
  189. )
  190.  
  191. goto top
Advertisement
Add Comment
Please, Sign In to add comment