From 2ebc784700241f21f44460e5ca44d6695e4bfe2e Mon Sep 17 00:00:00 2001 From: c79 <45520305+c79@users.noreply.github.com> Date: Mon, 4 Nov 2019 23:05:14 +0200 Subject: [PATCH] Fix hostname showing directory when no hostname Because `dnsmasq.leases` shows not having a hostname as `*`, bash will expand it to directory if we weren't using double quotes. This adds double quotes to prevent expansion. Closes #144 --- create_ap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_ap b/create_ap index 6b3b5ca..f23d444 100755 --- a/create_ap +++ b/create_ap @@ -869,7 +869,7 @@ print_client() { if [[ -f $CONFDIR/dnsmasq.leases ]]; then line=$(grep " $mac " $CONFDIR/dnsmasq.leases | tail -n 1) ipaddr=$(echo $line | cut -d' ' -f3) - hostname=$(echo $line | cut -d' ' -f4) + hostname=$(echo "$line" | cut -d' ' -f4) fi [[ -z "$ipaddr" ]] && ipaddr="*"