#!/bin/bash

ip a | grep -q wg0 && wg_status="wireguard running " || wg_status=""
case "$(cat /sys/class/net/wlan0/operstate 2>/dev/null)" in
  down) printf "${wg_status} no wifi" ;;
  up)
    [ -n "$(ip address show dev wlan0 | grep 'inet ')" ] && printf "${wg_status}"|| printf "${wg_status}no ip" ;;
esac
