Skip to content

Commit

Permalink
remove GNU grep dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mueslo committed Oct 11, 2018
1 parent 16c6685 commit 28e0da8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/net/hass/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define Package/hass
SECTION:=net
CATEGORY:=Network
TITLE:=Wireless device tracker for Home Assistant
DEPENDS:=+hostapd-utils +curl +grep
DEPENDS:=+hostapd-utils +curl
PKGARCH:=all
endef

Expand Down
2 changes: 1 addition & 1 deletion packages/net/hass/files/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function get_ip {

function get_host_name {
# get hostname for mac
nslookup "$(get_ip $1)" | grep -oP "(?<=name = ).*$"
nslookup "$(get_ip $1)" | grep -o "name = .*$" | cut -d ' ' -f 3
}

function push_event {
Expand Down
2 changes: 1 addition & 1 deletion packages/net/hass/files/hassd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sync_state
# will run in subshell
ubus listen ubus.object.add | \
while read line ; do
interface=$(echo "$line" | grep -oP '"path":"hostapd\.\K[^"]*(?="\} \}$)')
interface=$(echo "$line" | grep -o '"path":"hostapd\.[^"]*"' | cut -d '"' -f 4 | cut -d '.' -f 2)
if [ $? = 0 ]
then
logger -t $0 -p info "$interface is up, setting up hook"
Expand Down

0 comments on commit 28e0da8

Please sign in to comment.