From 1c6f8260bf5e15f2498933d416cb106a08a264c6 Mon Sep 17 00:00:00 2001 From: Ejner Fergo <efer@dtu.dk> Date: Thu, 15 Oct 2020 15:01:30 +0200 Subject: [PATCH] fix systemctl version grep again --- comp-backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comp-backup.sh b/comp-backup.sh index 275953b..c0f3c7a 100755 --- a/comp-backup.sh +++ b/comp-backup.sh @@ -86,7 +86,8 @@ elif [ $HOST_OS = 'Linux' ]; then echo "No systemd - Backup will need to be run manually" else SYSTEMD=1 - sysd_ver=$(systemctl --version |grep -o '\s[0-9][0-9][0-9]\s') + # look for 3 digits with a space before and/or after + sysd_ver=$(systemctl --version |grep -o '\s[[:digit:]]\{3\}\s\{,1\}') if [ $sysd_ver -lt 220 ]; then echo "No 'systemctl --user' capability" echo "Installing system wide" -- GitLab