From 06fe371b1df80492b300093b7db77ee47ad7dc39 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:56:17 +0100 Subject: [PATCH] create type explorer "runs" Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/cksum | 34 ------------------- conf/type/__process/explorer/{exists => runs} | 10 ++---- 2 files changed, 3 insertions(+), 41 deletions(-) delete mode 100755 conf/type/__process/explorer/cksum rename conf/type/__process/explorer/{exists => runs} (85%) diff --git a/conf/type/__process/explorer/cksum b/conf/type/__process/explorer/cksum deleted file mode 100755 index dcad99ba..00000000 --- a/conf/type/__process/explorer/cksum +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Retrieve the md5sum of a file to be created, if it is already existing. -# - -destination="/$__object_id" - -if [ -e "$destination" ]; then - if [ -f "$destination" ]; then - cksum < "$destination" - else - echo "NO REGULAR FILE" - fi -else - echo "NO FILE FOUND, NO CHECKSUM CALCULATED." -fi diff --git a/conf/type/__process/explorer/exists b/conf/type/__process/explorer/runs similarity index 85% rename from conf/type/__process/explorer/exists rename to conf/type/__process/explorer/runs index f8b85671..685dd19e 100755 --- a/conf/type/__process/explorer/exists +++ b/conf/type/__process/explorer/runs @@ -18,13 +18,9 @@ # along with cdist. If not, see . # # -# Check whether file exists or not +# Check whether a process runs # -destination="/$__object_id" +process="$__object_id" -if [ -e "$destination" ]; then - echo yes -else - echo no -fi +pgrep -f "$process" || true