diff --git a/dhcp b/dhcp index 19914c9..d72d49a 100755 --- a/dhcp +++ b/dhcp @@ -5,9 +5,8 @@ #20200225 km4ack DHCP=$(cat /var/lib/misc/dnsmasq.leases) -HSS=$(cat /usr/bin/autohotspotN | grep "ip a add" | awk '{ print $4 }' | sed 's/\/24//') -CIP=$(ip address show dev wlan0 | grep -v inet6 | grep inet | awk '{ print $2 }' | sed 's/\/24//') -#CIP=$(ifconfig | grep -A 1 wlan0 | grep inet | awk '{ print $2 }') +HSS=$(cat /usr/bin/autohotspotN | grep "ip a add" | awk '{ print $4 }' | cut -f 1 -d \/) +CIP=$(ip address show dev wlan0 | grep -v inet6 | grep inet | awk '{ print $2 }' | cut -f 1 -d \/) if [ $HSS = $CIP ] then diff --git a/hotspot-menu b/hotspot-menu index 3342754..70ac2b5 100755 --- a/hotspot-menu +++ b/hotspot-menu @@ -13,9 +13,8 @@ HS=$(systemctl is-enabled autohotspot) HSR=$(systemctl is-active autohotspot) CURRENTNAME=$(sudo cat /etc/hostapd/hostapd.conf | grep ssid= | head -1 | sed 's/ssid=//') CURRENTPASS=$(sudo cat /etc/hostapd/hostapd.conf | grep wpa_passphrase= | sed 's/wpa_passphrase=//') -HSIP=$(cat /usr/bin/autohotspotN | grep "ip a add" | awk '{ print $4 }' | sed 's/\/24//') -CIP=$(ip address show dev wlan0 | grep -v inet6 | grep inet | awk '{ print $2 }' | sed 's/\/24//') -#CIP=$(ifconfig | grep -A 1 wlan0 | grep inet | awk '{ print $2 }') +HSIP=$(cat /usr/bin/autohotspotN | grep "ip a add" | awk '{ print $4 }' | cut -f 1 -d \/) +CIP=$(ip address show dev wlan0 | grep -v inet6 | grep inet | awk '{ print $2 }' | cut -f 1 -d \/) if [ $HSR = 'inactive' ] then diff --git a/knowssid b/knowssid index 1e601d8..6d6476b 100755 --- a/knowssid +++ b/knowssid @@ -9,7 +9,7 @@ HS=$(systemctl is-enabled autohotspot) HSR=$(systemctl is-active autohotspot) CURRENTNAME=$(sudo cat /etc/hostapd/hostapd.conf | grep ssid= | head -1 | sed 's/ssid=//') CURRENTPASS=$(sudo cat /etc/hostapd/hostapd.conf | grep wpa_passphrase= | sed 's/wpa_passphrase=//') -HSIP=$(cat /usr/bin/autohotspotN | grep "ip a add" | sed 's/ip\ a\ add\ //' | sed 's/\/24.*$//' | tr -d " ") +HSIP=$(cat /usr/bin/autohotspotN | grep "ip a add" | awk '{ print $4 }' | cut -f 1 -d \/) if [ $HSR = 'inactive' ] then diff --git a/setup b/setup index 93052b3..5cc1bc0 100644 --- a/setup +++ b/setup @@ -1,7 +1,8 @@ #!/bin/bash #setup script for hotspot tools -#20200221 km4ack + +sudo apt -y install xterm DIR=$HOME/hotspot-tools-lite