#! /bin/bash # Gentoo version # Some colors GREEN='\033[0;32m' RED='\033[0;31m' DEFAULT='\033[0m' # Defaults values DIR="/usr/src/" PREFIX='linux-' EXTENSION='.tar.xz' MAINLINE=1 CURRENT_VERSION=`uname -r` # Function to script script if step fail isPreviousStepOk () { if [ $? -ne 0 ]; then echo -e "${RED} Error!${DEFAULT}" exit 1 fi } if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 sudo $0 exit 1 fi # Get last kernel version INFO=`curl -Ls https://www.kernel.org/ | perl -lne 'BEGIN{$/=""} print "$1 $2" if \ /latest_link.*?(.*?)