mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-28 13:02:35 +02:00
Fake wifi scan
This commit is contained in:
parent
ef22cb77c6
commit
2878d232fe
50
scripts/wifi_scan_fake
Executable file
50
scripts/wifi_scan_fake
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
sleep 1
|
||||
cat << EOF
|
||||
[{
|
||||
"ssid": "befree",
|
||||
"mode": "Infra",
|
||||
"channel": 11,
|
||||
"rate": 195,
|
||||
"signal": 74,
|
||||
"security": "WPA1 WPA2",
|
||||
"inuse": false
|
||||
},
|
||||
{
|
||||
"ssid": "Telecom-32949531",
|
||||
"mode": "Infra",
|
||||
"channel": 1,
|
||||
"rate": 270,
|
||||
"signal": 67,
|
||||
"security": "WPA1 WPA2",
|
||||
"inuse": false
|
||||
},
|
||||
{
|
||||
"ssid": "Vodafone-WiFi",
|
||||
"mode": "Infra",
|
||||
"channel": 13,
|
||||
"rate": 130,
|
||||
"signal": 44,
|
||||
"security": "",
|
||||
"inuse": false
|
||||
},
|
||||
{
|
||||
"ssid": "Vodafone-33516851",
|
||||
"mode": "Infra",
|
||||
"channel": 13,
|
||||
"rate": 130,
|
||||
"signal": 44,
|
||||
"security": "WPA2",
|
||||
"inuse": false
|
||||
},
|
||||
{
|
||||
"ssid": "TeleTu_f0842f8dbef1",
|
||||
"mode": "Infra",
|
||||
"channel": 11,
|
||||
"rate": 130,
|
||||
"signal": 39,
|
||||
"security": "WPA1 WPA2",
|
||||
"inuse": false
|
||||
}
|
||||
]
|
||||
EOF
|
@ -12,7 +12,8 @@ module.exports = ({ define }) => {
|
||||
|
||||
function getWifiScan() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const scriptPath = join(__dirname, '..', '..', '..', '..', 'scripts', 'wifi_scan')
|
||||
const scriptName = (process.env.NODE_ENV === 'production') ? 'wifi_scan' : 'wifi_scan_fake'
|
||||
const scriptPath = join(__dirname, '..', '..', '..', '..', 'scripts', scriptName)
|
||||
exec(scriptPath, {}, (err, stdout) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
|
Loading…
Reference in New Issue
Block a user