]> code.delx.au - monosys/commitdiff
find-services-to-restart
authorJames Bunton <jamesbunton@delx.net.au>
Wed, 11 Feb 2015 10:27:18 +0000 (21:27 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Wed, 11 Feb 2015 10:27:18 +0000 (21:27 +1100)
scripts/find-services-to-restart [new file with mode: 0755]

diff --git a/scripts/find-services-to-restart b/scripts/find-services-to-restart
new file mode 100755 (executable)
index 0000000..65a1f9c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+for pid in $(sudo lsof +c 0 / | grep DEL | awk '{print $2}'); do
+    echo -n "sudo systemctl restart "
+    systemctl status "$pid" | head -n1 | awk '{print $2}'
+done
+