From 02ad69bb283014bf450e578e72102b1fa14e269d Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Fri, 7 Jun 2024 17:27:48 +0200 Subject: [PATCH 1/3] feat(script): Check deleted files held by an open fd (#1) --- arch-needs-restart.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch-needs-restart.sh b/arch-needs-restart.sh index a6237f5..bbfc33b 100755 --- a/arch-needs-restart.sh +++ b/arch-needs-restart.sh @@ -22,6 +22,13 @@ if [[ -n $libs ]]; then rc=0 fi +binaries=$(lsof -n +c 0 2> /dev/null | grep -- '(deleted)' | awk '1 { print $1 ": " $(NF-1) " " $NF }' | sort -u) +if [[ -n $binaries ]]; then + cat <<< $binaries + echo "# REGULAR FILES: reboot required" + rc=0 +fi + active_kernel=$(uname -r) current_kernel=$(get_boot_kernel) if [[ $active_kernel != $current_kernel ]]; then -- 2.47.2 From 5ba3bcc15ccffa919ba04acaec50047eab1a6727 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Fri, 7 Jun 2024 17:32:39 +0200 Subject: [PATCH 2/3] feat(meta): Add .gitignore (#1) --- .gitignore | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1c152f --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +.idea \ No newline at end of file -- 2.47.2 From 9b62bcad6c852a829bb8a3c5548f55f0f7d604b6 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Fri, 7 Jun 2024 17:34:14 +0200 Subject: [PATCH 3/3] refactor(script): Var name carries arbitrary files (#1) --- arch-needs-restart.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch-needs-restart.sh b/arch-needs-restart.sh index bbfc33b..5c95dd9 100755 --- a/arch-needs-restart.sh +++ b/arch-needs-restart.sh @@ -22,9 +22,9 @@ if [[ -n $libs ]]; then rc=0 fi -binaries=$(lsof -n +c 0 2> /dev/null | grep -- '(deleted)' | awk '1 { print $1 ": " $(NF-1) " " $NF }' | sort -u) -if [[ -n $binaries ]]; then - cat <<< $binaries +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" rc=0 fi -- 2.47.2