Skip to content

Instantly share code, notes, and snippets.

@colby
Last active August 29, 2015 14:17
Show Gist options
  • Save colby/da2d39363ccfd5c2a116 to your computer and use it in GitHub Desktop.
Save colby/da2d39363ccfd5c2a116 to your computer and use it in GitHub Desktop.
A simple script to upgrade OpenSSL related packages and restart services on Ubuntu/Debian
#!/bin/bash
awk=$(which awk || echo 'missing: install awk' && exit 1)
# update apt
sudo apt-get update
# get ssl related packages from simulated upgrade
sudo apt-get upgrade -s | grep ssl | grep Inst | $awk '{print $2}' | xargs -t sudo apt-get install -y
# bounce ssl using services
sudo lsof -n | grep ssl | grep DEL | $awk '{print $1}' | uniq | xargs -t -I X sudo service X restart
# should now return nothing
sudo lsof -n | grep ssl | grep DEL
@colby
Copy link
Author

colby commented Mar 19, 2015

To run this script

curl -L https://gist.githubusercontent.com/colby/da2d39363ccfd5c2a116/raw/7e9fb99888b52844a07fd524cfae9a67bdbb92be/openssl.sh | sudo bash -s --

or

wget -O /tmp/openssl.sh https://gist.githubusercontent.com/colby/da2d39363ccfd5c2a116/raw/7e9fb99888b52844a07fd524cfae9a67bdbb92be/openssl.sh; bash /tmp/openssl.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment