Created
June 17, 2014 06:36
-
-
Save pry0cc/65e015de4ed6c11ecfb7 to your computer and use it in GitHub Desktop.
A Ruby script to check for the latest stable linux kernel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
url = 'https://kernel.org' | |
data = Nokogiri::HTML(open(url)) | |
version_no = data.at_css("#latest_link").text.strip | |
local_version = `uname -r` | |
machine_name = `cat /etc/hostname`.chomp.capitalize | |
repo_version = `pacman -Ss linux-headers`[19...31] | |
puts "The latest linux kernel release is version #{version_no}" | |
puts "And your the kernel installed on #{machine_name} is #{local_version}" | |
puts "The latest kernel in the repo is #{repo_version}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment