about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xdscip41
1 files changed, 22 insertions, 19 deletions
diff --git a/dscip b/dscip
index 61208a0..19a4e84 100755
--- a/dscip
+++ b/dscip
@@ -33,7 +33,7 @@ fi
 # Check if script is currently running, and if not, reset LOCK #
 if [ -f "$WORKING_DIRECTORY/LOCK" ]; then
 	LOCKED_PID=$(cat "$WORKING_DIRECTORY/LOCK")
-	if ps -p "$LOCKED_PID"; then
+	if ps -p "$LOCKED_PID" > /dev/null; then
 		echo "Script still running. Exiting..."
 		exit 0
 	else
@@ -44,26 +44,29 @@ fi
 
 echo "$$" > "$WORKING_DIRECTORY/LOCK"
 
-# Print variables
-{
-echo "################################################################################";
-date;
-echo "################################################################################";
-echo "DSCIP_GITREPO=$DSCIP_GITREPO";
-echo "DSCIP_GITMODE=$DSCIP_GITMODE";
-echo "DSCIP_BRANCH=$DSCIP_BRANCH";
-echo "WORKING_DIRECTORY=$WORKING_DIRECTORY";
-echo "DSCIP_PRE_CMD=$DSCIP_PRE_CMD";
-echo "DSCIP_BUILD_CMD=$DSCIP_BUILD_CMD";
-echo "DSCIP_POST_CMD=$DSCIP_POST_CMD";
-echo "DSCIP_DAEMON=$DSCIP_DAEMON";
-echo "DSCIP_DAEMON_FORK=$DSCIP_DAEMON_FORK";
-echo "DSCIP_SLEEP=$DSCIP_SLEEP";
-echo "DSCIP_DISREGARD_COMMIT_CHECK=$DSCIP_DISREGARD_COMMIT_CHECK";
-echo "DSCIP_OUTPUT_TO=$DSCIP_OUTPUT_TO"
-} >> "$DSCIP_OUTPUT_TO"
+
 
 build () {
+	# Print variables #
+	{
+		echo "################################################################################";
+		date;
+		echo "################################################################################";
+		echo "DSCIP_GITREPO=$DSCIP_GITREPO";
+		echo "DSCIP_GITMODE=$DSCIP_GITMODE";
+		echo "DSCIP_BRANCH=$DSCIP_BRANCH";
+		echo "WORKING_DIRECTORY=$WORKING_DIRECTORY";
+		echo "DSCIP_PRE_CMD=$DSCIP_PRE_CMD";
+		echo "DSCIP_BUILD_CMD=$DSCIP_BUILD_CMD";
+		echo "DSCIP_POST_CMD=$DSCIP_POST_CMD";
+		echo "DSCIP_DAEMON=$DSCIP_DAEMON";
+		echo "DSCIP_DAEMON_FORK=$DSCIP_DAEMON_FORK";
+		echo "DSCIP_SLEEP=$DSCIP_SLEEP";
+		echo "DSCIP_DISREGARD_COMMIT_CHECK=$DSCIP_DISREGARD_COMMIT_CHECK";
+		echo "DSCIP_OUTPUT_TO=$DSCIP_OUTPUT_TO"
+	} >> "$DSCIP_OUTPUT_TO"
+
+	# Grab remote sources #
 	if [ "$DSCIP_GITMODE" = "clone" ]; then
 		rm -rf "$WORKING_DIRECTORY/wrkdir" # Clean Up #
 		git clone --depth 1 -b "$DSCIP_BRANCH" "$DSCIP_GITREPO" wrkdir >> "$DSCIP_OUTPUT_TO" 2>&1 # Clone git #