#!/bin/bash # A simple script that records the kernel version # I run it via cron when the system boots: # @reboot /[path]/kernel.sh # Log file path and filename logFile="/tmp/kernel.txt" if [ -f "$logFile" ]; then checkString=$(/bin/uname -a) #echo checkString: $checkString countCheck=$(/bin/grep -ixc "$checkString" "$logFile") #echo countCheck: $countCheck if [ $countCheck -eq 0 ]; then echo $checkString >>$logFile fi else echo Creating a new logFile: [$logFile] echo $checkString >>$logFile fi #EoF