#!/bin/bash connected="$(mconnectctl show-device /org/mconnect/device/2 | sed -n 9,9p | awk '{print $2}')" if [[ $connected == "false" ]]; then exit 1 fi