#!/bin/bash . include.sh id=$1 trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT iwinfo() { interface=$1 iwconfig "$interface" | sed -r 's/ {2,}/\n/g' | sed -e '/^\s*$/d' -e 's/:\s*/=/' \ -e '1s/^/Interface=/' \ -e '2s/^/MAC Protocol=/' } while connected_to_x_server; do { printf 'label ' iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' } | sponge >> "${WMII_DIR}/rbar/${id}" sleep 1 done