#!/bin/sh

if [ $(connmanctl state | awk '/State/ {print $NF}') == 'online' ]; then
  connmanctl disable wifi
else
  connmanctl enable wifi
fi