#!/bin/bash

# Restart the MacOS "Dock".  This sometimes helps with Mission Control issues, possibly more.

# shellcheck disable=SC2009
pids="$(ps -ef | grep '[/]System/Library/CoreServices/Dock.app/Contents/MacOS/Dock' | awk ' { print $2 }')"

if [ "$pids" = "" ]
then
    echo "$0: No Dock pids found"
else
    echo "$0: Killing pids $pids"
    # shellcheck disable=SC2086
    kill -9 $pids
fi