update
This commit is contained in:
parent
d43ce1ee0e
commit
0aee5a8029
1 changed files with 21 additions and 0 deletions
21
logs
Executable file
21
logs
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "--user" ]; then
|
||||
shift
|
||||
scope="--user"
|
||||
else
|
||||
scope=""
|
||||
fi
|
||||
|
||||
[ -z "$1" ] && { echo "missing service name"; exit 1; }
|
||||
|
||||
service="$1"
|
||||
|
||||
# Check if the unit exists
|
||||
if ! systemctl $scope status "$service" >/dev/null 2>&1; then
|
||||
echo "no such service: $service"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Follow logs
|
||||
journalctl $scope -f -u "$service"
|
||||
Loading…
Reference in a new issue