Created
July 1, 2014 16:34
-
-
Save syndicut/f5acdec74639b28879b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
LIBSSL=`dpkg -l libssl* | grep ii | awk '{ print $2 }'` | |
LIST=$( for i in `dpkg -L $LIBSSL|grep /lib/` ; do if [ -f $i ] ; then echo $i ; fi ; done ) | |
LIST=`for i in $LIST ; do lsof -n $i|tail -n+2 ; done|awk '{print $2}'|sort|uniq` | |
LIST=$(for i in $LIST ; do echo "`readlink /proc/$i/exe`"; done | sort | uniq) | |
RESTART=$(for i in $LIST; do | |
BINARY=$i | |
if [ -x $BINARY ]; then | |
PACKAGE=`dpkg -S $BINARY | cut -f 1 -d ':'` | |
SCRIPT=`dpkg -L $PACKAGE | grep '/etc/init.d/'` | |
fi | |
if [ -z $SCRIPT ]; then | |
SCRIPT="/etc/init.d/"`ls -1 /etc/init.d/ | grep $(basename $BINARY)` | |
fi | |
SERVICE=`basename $SCRIPT` | |
echo "$SERVICE" | |
done | sort | uniq) | |
for s in $RESTART; do | |
service $s --full-restart | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment