Skip to content

Commit abf8ffd

Browse files
author
Tim Heinsohn
committed
termux: use wlan0 IP, fix Android permission issue on retrieval
1 parent df0dffb commit abf8ffd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

termux/setup

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pkill sshd || true
4949
sshd
5050

5151
# Get the device's IP address
52-
IP_ADDRESS=$(ifconfig 2>/dev/null | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -n 1)
52+
IP_ADDRESS=$(ifconfig 2>/dev/null | grep -A1 wlan0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -n 1)
5353

5454
# Get username
5555
USERNAME=$(whoami)

0 commit comments

Comments
 (0)