#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-install-ubuntu-kernel.txt ######################## #### path: /var/www/ss-install-ubuntu-kernel ####################################################### #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Reinstalls the Ubuntu (OS) Linux kernel for SlickStack servers (idempotent) ########## #### module version: Ubuntu 20.04 LTS ############################################################## #### sourced by: ss-install ######################################################################## #### bash aliases: ss install ubuntu kernel, ss install kernel ##################################### #################################################################################################### ## SS-CONFIG MUST BE PROPERLY CONFIGURED AND ON CURRENT BUILD BEFORE RUNNING SS-INSTALL ## ## ENSURE YOUR SS-CONFIG BUILD REMAINS CURRENT BY RUNNING SS-UPDATE OCCASIONALLY ## ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Install-Ubuntu-Kernel: Message (Begin Script) ############################################## #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-install-ubuntu-kernel: Reinstalls the Ubuntu (OS) Linux kernel for SlickStack servers (idempotent)... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Install-Ubuntu-Kernel: Cleanup Temporary Files ############################################# #################################################################################################### ## delete tmp files ## rm /tmp/sysctl* #################################################################################################### #### SS-Install-Ubuntu-Kernel: Install (Optimize) The Ubuntu Linux Kernel ########################## #################################################################################################### ## backup current Ubunt kernel file ## cp /etc/sysctl.conf /etc/sysctl.conf.bak ## download latest versions ## wget -O /tmp/sysctl.conf http://mirrors.slickstack.io/ubuntu/sysctl.txt ## copy files to their destinations ## cp /tmp/sysctl.conf /etc/sysctl.conf ## reset permissions ## chown root:root /etc/sysctl.conf chmod 0664 /etc/sysctl.conf #################################################################################################### #### SS-Install-Ubuntu-Kernel: Reset Permissions (Ubuntu Kernel) ################################### #################################################################################################### ## run ss-perms-ubuntu-kernel ## source /var/www/ss-perms-ubuntu-kernel #################################################################################################### #### SS-Install-Ubuntu-Kernel: Cleanup Temporary Files ############################################# #################################################################################################### ## delete tmp files ## rm /tmp/sysctl* #################################################################################################### #### SS-Install-Ubuntu-Kernel: Touch Timestamp File (End Script) ################################### #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-install-ubuntu-kernel #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: ## SS_EOF