.dotfiles/.bin/wait-for-service

13 lines
165 B
Bash
Executable file

#!/usr/bin/env sh
if [ "$1" = "--user" ]; then
user="--user"
shift
fi
target="$1"
until systemctl $user is-active --quiet "$target"
do
sleep 0.5
done