From 05b1b5032e048e124160ac4c3beb51957165e412 Mon Sep 17 00:00:00 2001 From: toloveru Date: Sun, 16 Apr 2017 01:00:18 +0200 Subject: [PATCH] Improved username handling --- kernelcheck | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernelcheck b/kernelcheck index 2dfca23..4da2351 100755 --- a/kernelcheck +++ b/kernelcheck @@ -5,7 +5,8 @@ latest="$(wget -qO - 'https://kernel.org' | sed -n '/stable:/{n;p;}' | sed 's.[a-z]\|<\|>\|/\|[[:space:]]..g')" # Kernel version on kernel.org current="$(uname -r)" # Current kernel version -user="$(users)" # User account +uid=1000 # User ID. Change as per your needs. +user="$(awk -v val=$uid -F ":" '$3==val{print $1}' /etc/passwd)" # User account (used by sudo -u) cores="$(nproc)" # Processor cores if [ -f /tmp/kernelcheck/kernelcheck.pid ] # Create a pid file to avoid concurrent processes