Advertisement
TheStuntman

Athena Hotspot

Sep 4th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.06 KB | None | 0 0
  1. @echo off
  2. title Athena Network Monitor
  3. color 0A
  4.  
  5.  ::Set your ssid/password here
  6. set ssid=Athena
  7. set password=Midgard123
  8.  
  9.  :: is the wlan compatible?
  10.  
  11. if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt" (
  12. netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  13. timeout /t 2 >nul
  14. ) else (
  15. type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  16. timeout /t 2 >nul
  17. netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  18. )
  19.  
  20.  
  21. for /f "delims=: tokens=2" %%c in ('findstr /c:"Hosted network supported" %HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt') do set "compatible=%%c"
  22.  
  23. if %compatible%=="no" (
  24. Echo Your Wlan is not compatible with Athena
  25. del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
  26. PAUSE
  27. ) else (
  28. Echo Starting...
  29. del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
  30. )
  31.  
  32.  
  33.  :: Beginning of loop
  34. :top
  35.  
  36.  :: Detect whether clients.txt exists or not
  37. if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt" (
  38. netsh wlan show hostednetwork >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
  39. ) else (
  40. type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
  41. )
  42.  
  43.  
  44.  :: assign status to a variable
  45. for /f "delims=: tokens=2" %%t in ('findstr /c:"Status" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "started=%%t"
  46.  
  47.  :: assign max clients to a variable
  48. for /f "delims=: tokens=2" %%m in ('findstr /c:"Max number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "maxclients=%%m"
  49.  
  50.  :: assign authentication to a variable
  51. for /f "delims=: tokens=2" %%l in ('findstr /c:"Authentication" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "authmode=%%l"
  52.  
  53.  :: Get Sent Bytes
  54. for /f "tokens=3" %%a in ('netstat -e ^| findstr /i bytes') do set "sent=%%a"
  55.  
  56.  :: Get Received Bytes
  57. for /f "tokens=2" %%a in ('netstat -e ^| findstr /i bytes') do set "rec=%%a"
  58.  
  59.  :: Shorten to KB accuracy to avoid batch math error
  60. set sentkb=%sent:~0,-3%
  61. set reckb=%rec:~0,-3%
  62.  
  63.  :: Do some math
  64. set /a sentMB = %sentkb% / 1000
  65. set /a recMB = %reckb% / 1000
  66.  
  67.  
  68.  :: Set our client variable
  69. for /f "delims=" %%a in ('FINDSTR c:"Number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "clients=%%a"
  70.  
  71.  :: I'm pretty part
  72. cls
  73. Echo ===============================================================================
  74. Echo                             Athena Network Monitor
  75. Echo.
  76. Echo     SSID: %ssid%
  77. Echo    %authmode%: %password%
  78. Echo     Status: %started%
  79. Echo.
  80. Echo ===============================================================================
  81. Echo        Bytes Used
  82. Echo ===============================================================================
  83. Echo     %sentMB% MB Uploaded - %recMB% MB Downloaded
  84. Echo.
  85. Echo ===============================================================================
  86. Echo        Clients Connected
  87. Echo ===============================================================================
  88. Echo %clients% /%maxclients%
  89. timeout /t 2 >nul
  90. if %started%=="Not Started" (
  91. netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%password% keyUsage=persistent
  92. timeout /t 2 >nul
  93. netsh wlan start hostednetwork
  94. timeout /t 2 >nul
  95. )
  96. goto top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement