Merge pull request 'fix(script): Trigger restart only on FDs for binaries (#3)' (#4) from 3/fix-3-only-reboot-when-binaries-change into main

Reviewed-on: #4

Closes #3
This commit is contained in:
hygienic-books 2024-06-19 18:17:55 +00:00
commit 3f97a899f3

View File

@ -22,10 +22,10 @@ if [[ -n $libs ]]; then
rc=0 rc=0
fi fi
regular_files=$(lsof -n +c 0 2> /dev/null | grep -- '(deleted)' | awk '1 { print $1 ": " $(NF-1) " " $NF }' | sort -u) binaries=$(lsof -n +c 0 2> /dev/null | grep -- '(deleted)' | awk '$(NF-1) ~ /\/s?bin\// { print $1 ": " $(NF-1) " " $NF }' | sort -u)
if [[ -n $regular_files ]]; then if [[ -n $binaries ]]; then
cat <<< $regular_files cat <<< $binaries
echo "# REGULAR FILES: reboot required" echo "# BINARIES: reboot required"
rc=0 rc=0
fi fi