1
0
dotfiles/.config/zsh/lib/systemd.zsh
Konstantin Demin 8834da817c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
zsh: update
2024-03-04 15:35:55 +03:00

19 lines
339 B
Bash

#!/bin/zsh
z-systemctl() {
command systemctl --quiet --no-pager --lines=0 --no-ask-password "$@"
}
z-systemctl-status-rc() {
z-systemctl status "$@" >/dev/null 2>&1
}
z-systemctl-exists() {
z-systemctl-status-rc "$@"
case "$?" in
0 | 1 | 3 ) return 0 ;;
## also 4 = "no such unit"
* ) return 1 ;;
esac
}