Commit a63f8b3b authored by Seblu's avatar Seblu
Browse files

checkservices: Only list executable deleted files

parent 722fb6e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ services=($(systemctl -t service --full|grep \.service|grep running|sed -rn 's/^

for svc in "${services[@]}"; do
	pid=$(systemctl show "$svc"|sed -nr 's/^MainPID=(.*)/\1/p')
	deleted=$(grep '(deleted)' "/proc/$pid/maps")
	deleted=$(grep '(deleted)' "/proc/$pid/maps"|sed -nr 's|^\S+ ..x. \S+ \S+ \S+ \s+||p'|sort|uniq)
	if [[ -n $deleted ]]; then
		echo systemctl restart "$svc"
		[[ $systemd_cmd ]] && systemctl "$systemd_cmd" "$svc"