diff --git a/mrgkernel.sh b/mrgkernel.sh new file mode 100755 index 0000000..59d7c8f --- /dev/null +++ b/mrgkernel.sh @@ -0,0 +1,96 @@ +#! /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 +SHOW_MENU_CONFIG=0 +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.*?(.*?)