Added ap/ip (network identity) scripts to [api:fetch]
This commit is contained in:
parent
f7b5445ded
commit
6bad0902f2
|
@ -12,8 +12,8 @@
|
|||
'default' => [],
|
||||
'feature' => [],
|
||||
'identity' => [
|
||||
'ap' => preg_replace('/\s+/', '', file_get_contents(TMP_DIR.'/net.ap')),
|
||||
'ip' => preg_replace('/\s+/', '', file_get_contents(TMP_DIR.'/net.ip'))
|
||||
'ap' => syscall(TMP_DIR.'/net.ap'),
|
||||
'ip' => syscall(TMP_DIR.'/net.ip')
|
||||
]
|
||||
];
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# (1) Get wireless iface #
|
||||
IFACE=`ifconfig | grep -o -P "^w\w+"`;
|
||||
|
||||
# (2) Get Access Point ID #
|
||||
AP=`iwconfig $IFACE | grep -o -P 'ESSID:"SATS_.+"' | sed 's/ESSID:"SATS_//' | sed 's/"$//'`;
|
||||
|
||||
echo $AP;
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# (1) Get wireless iface #
|
||||
IFACE=`ifconfig | grep -o -P "^w\w+"`;
|
||||
|
||||
# (2) Get Access Point ID #
|
||||
IP=`ifconfig $IFACE | grep -o -P 'inet addr:[\d\.]+' | sed 's/inet addr://'`;
|
||||
|
||||
echo $IP;
|
Loading…
Reference in New Issue