#!/usr/bin/env sh

user=""
target="$1"

if [ "$1" = "--user" ]; then
    user="--user"
    target="$2"
fi


until systemctl $user is-active --quiet "$target"
do
    sleep 0.5
done