From 21ccd036bdda46c5232777a6f554c9264085bf7c Mon Sep 17 00:00:00 2001 From: BrainwreckedTech Date: Wed, 25 Jan 2023 00:13:56 -0500 Subject: [PATCH] Add script for restart hooks --- restart-hook | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 restart-hook diff --git a/restart-hook b/restart-hook new file mode 100644 index 0000000..7b9b4c5 --- /dev/null +++ b/restart-hook @@ -0,0 +1,9 @@ +#!/bin/sh + +for UNITFILE in ${1}; do + if /usr/bin/systemctl is-active --quiet "${UNITFILE}"; then + /usr/bin/systemctl restart "${UNITFILE}" + else + echo >&2 " Skipped: ${UNITFILE} not active" + fi +done