From 84775ad2577564414d81a053957662ab9d7ed05e Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Tue, 12 Dec 2017 17:50:44 +0000 Subject: Only restart services if the safe list grep matched (this was a bad bug!) --- portage-update.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/portage-update.sh b/portage-update.sh index 0a1c807..02e31de 100755 --- a/portage-update.sh +++ b/portage-update.sh @@ -54,8 +54,10 @@ revdep-rebuild -- -av || exit 1 DELETED=$(lsof -n | grep "DEL\|deleted") for service in ${SAFE_SERVICES[@]}; do echo "$DELETED" | grep -Eq "^$service\s+[0-9]" - echo "/etc/init.d/$service restart" - /etc/init.d/"$service" restart || exit 1 + if [ "$?" -eq 0 ]; then + echo "/etc/init.d/$service restart" + /etc/init.d/"$service" restart || exit 1 + fi done # Print any remaining processes that have open but deleted files -- cgit v1.2.3