Skip to content

Instantly share code, notes, and snippets.

@mikebratt
Last active March 14, 2024 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebratt/37326cce837c7825737cd77cc6e7c117 to your computer and use it in GitHub Desktop.
Save mikebratt/37326cce837c7825737cd77cc6e7c117 to your computer and use it in GitHub Desktop.
needrestart settings
#!/bin/bash
if [[ -f "/etc/needrestart/needrestart.conf" ]]; then
# Disable "Pending kernel upgrade" prompt
sudo sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf
# Set Restart mode to automatic
sudo sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment