#!/bin/sh

eth="enp2s0"
wlan="wlp4s0"
ethstate=$(ip addr | grep "$eth:" | awk '{print $9}')
wlanstate=$(ip addr | grep "$wlan:" | awk '{print $9}')

if [ "$ethstate" = "DOWN" ]
then
    ethernet=" x"
else
    # stat=$(ifstat)
    # etx=$(echo "$stat" | grep "$eth" | awk '{print $9}')
    # erx=$(echo "$stat" | grep "$eth" | awk '{print $7}')
    ethernet=" "
fi

if [ "$wlanstate" = "DOWN" ]
then
    wifi="睊 x"
else
    ssid=$(iwgetid | cut -d \" -f2)
    wifi="直 $ssid"
fi
echo "$ethernet|$wifi"
