fix(script): Trigger restart only on FDs for binaries (#3) #4

Merged
hygienic-books merged 1 commits from 3/fix-3-only-reboot-when-binaries-change into main 2024-06-19 18:17:55 +00:00

View File

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