diff --git a/Makefile b/Makefile index a19c2eb..6f4aba5 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PREFIX?=/usr/bin HOOK_DIR= MAJOR=0 -MINOR=2 +MINOR=3 VERSION=v$(MAJOR).$(MINOR) @@ -24,7 +24,7 @@ CONF_DIR=/etc/smart-restart-conf.d HOOK_ACTION=install.action HOOK_ACTION_TEMPLATE=$(HOOK_ACTION).in DENYLIST_CONF_FILE=default-denylist -MAN_FILE=smart-restart.man1 +MAN_FILE=smart-restart.1 MAN_FILE_LOCATION=/usr/share/man/man1 @@ -37,7 +37,7 @@ all: srpm: sources sources: - tar czf ./smart-restart-v$(VERSION).tar.gz --transform 's,^,smart-restart-v$(VERSION)/,' bin conf Makefile smart-restart.spec doc/smart-restart.man1 + tar czf ./smart-restart-v$(VERSION).tar.gz --transform 's,^,smart-restart-v$(VERSION)/,' bin conf Makefile smart-restart.spec doc/smart-restart.1 install: $(info Dest: $(DEST_DIR)) diff --git a/bin/smart-restart.sh b/bin/smart-restart.sh index a72aee9..8fb5d21 100755 --- a/bin/smart-restart.sh +++ b/bin/smart-restart.sh @@ -14,10 +14,12 @@ readonly REBOOT_HINT_PATH=${REBOOT_HINT_PATH:-/run/smart-restart} readonly REBOOT_HINT_MARKER="${REBOOT_HINT_PATH}"/reboot-hint-marker readonly CONF_PATH=${CONF_PATH:-/etc/smart-restart-conf.d} readonly DENYLISTS=("${CONF_PATH}"/*-denylist) -# shellcheck disable=SC2207 -readonly PRE_RESTART=($(ls "$CONF_PATH"/*pre-restart | sort -n)) -# shellcheck disable=SC2207 -readonly POST_RESTART=($(ls "$CONF_PATH"/*post-restart | sort -n)) +# Pin name-sorted glob results (bash >= 5.3 honors GLOBSORT from the environment) +GLOBSORT=name +shopt -s nullglob +readonly PRE_RESTART=("$CONF_PATH"/*pre-restart) +readonly POST_RESTART=("$CONF_PATH"/*post-restart) +shopt -u nullglob SYSCTL_COMMAND="${SYSCTL_COMMAND:-systemctl}" NEEDS_RESTARTING_COMMAND="${NEEDS_RESTARTING_COMMAND:-/usr/bin/needs-restarting}" diff --git a/doc/smart-restart.man1 b/doc/smart-restart.1 similarity index 100% rename from doc/smart-restart.man1 rename to doc/smart-restart.1 diff --git a/smart-restart.spec b/smart-restart.spec index 68c60e1..e3275fb 100644 --- a/smart-restart.spec +++ b/smart-restart.spec @@ -44,7 +44,7 @@ make DEST_DIR=$RPM_BUILD_ROOT pkg_manager=%{pkg_manager} PREFIX=%{_bindir} insta %{_bindir}/%{name}.sh %config %{_sysconfdir}/%{_plugin_path}/install.action %config %{_sysconfdir}/smart-restart-conf.d/default-denylist -%doc %{_mandir}/man1/smart-restart.man1.gz +%doc %{_mandir}/man1/smart-restart.1* %changelog * Wed Mar 06 2024 Stanislav Uschakow - 0.1-1.amzn2023.0.1