From 0aee5a8029c8d529ee420c778d4e8368d999a60d Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Fri, 24 Apr 2026 20:05:22 +0200 Subject: [PATCH] update --- logs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 logs diff --git a/logs b/logs new file mode 100755 index 0000000..af3df01 --- /dev/null +++ b/logs @@ -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"