#!/bin/bash

set -eu
# set -o pipefail

# shellcheck disable=SC2009
pids=$(ps -ef | grep -E '[c]hrome|[c]hromium' | grep -v '[r]eset-chrome' | awk ' { print $2 }')

if [ "$pids" = "" ]
then
    echo "$0: No chrome or chromium processes detected"
else
    # shellcheck disable=SC2086
    echo "$0: Killing" $pids
    # shellcheck disable=SC2086
    kill -HUP $pids
fi