Improved username handling

This commit is contained in:
toloveru 2017-04-16 01:00:18 +02:00
parent 290b05f356
commit 05b1b5032e

View File

@ -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