#!/bin/sh
#
# get-pid - like pidof except restricted to users processes
# works with both busybox + GNU utils

# shellcheck disable=SC2312
ps -Ao user,pid,comm \
  | awk '$1 == "'"$(id -un)"'" && $3 ~ "'"$1"'" { print $2; s=1 } END { exit!s }'
