#!/bin/bash

type="${1}"
action="${2}"
devices=$(nmcli -g DEVICE device)

for d in ${devices};do
  if [ "$(nmcli -g GENERAL.TYPE device show ${d})" = "${type}" ];then
    nmcli device "${action}" "${d}"
  fi
done
