Index: trunk/ippTools/src/pubtool.c
===================================================================
--- trunk/ippTools/src/pubtool.c	(revision 25928)
+++ trunk/ippTools/src/pubtool.c	(revision 25929)
@@ -32,4 +32,5 @@
 
 static bool defineclientMode(pxConfig *config);
+static bool updateclientMode(pxConfig *config);
 static bool definerunMode(pxConfig *config);
 static bool pendingMode(pxConfig *config);
@@ -57,4 +58,5 @@
     switch (config->mode) {
         MODECASE(PUBTOOL_MODE_DEFINECLIENT, defineclientMode);
+        MODECASE(PUBTOOL_MODE_UPDATECLIENT, updateclientMode);
         MODECASE(PUBTOOL_MODE_DEFINERUN, definerunMode);
         MODECASE(PUBTOOL_MODE_PENDING, pendingMode);
@@ -94,8 +96,50 @@
     PXOPT_LOOKUP_STR(comment, config->args, "-comment",  false, false);
 
-    if (!publishClientInsert(config->dbh, 0, product, stage, workdir, comment)) {
-        psError(PS_ERR_UNKNOWN, false, "Database error");
-        return false;
-    }
+    if (!publishClientInsert(config->dbh, 0, 0, product, stage, workdir, comment)) {
+        psError(PS_ERR_UNKNOWN, false, "Database error");
+        return false;
+    }
+
+    return true;
+}
+
+static bool updateclientMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psMetadata *where = psMetadataAlloc(); // WHERE conditions
+    PXOPT_COPY_S64(config->args, where, "-client_id", "client_id", "==");
+    PXOPT_COPY_STR(config->args, where, "-product", "product", "==");
+    PXOPT_COPY_STR(config->args, where, "-stage", "stage", "==");
+    PXOPT_COPY_STR(config->args, where, "-comment", "comment", "LIKE");
+
+    PXOPT_LOOKUP_BOOL(active, config->args, "-active",  false);
+    PXOPT_LOOKUP_BOOL(inactive, config->args, "-inactive",  false);
+
+    if ((!active && !inactive) || (active && inactive)) {
+        psError(PS_ERR_UNKNOWN, false, "Must specify one, and only one, of -active and -inactive.");
+        psFree(where);
+        return false;
+    }
+
+    psString query = NULL;              // Query to run
+    psStringAppend(&query, "UPDATE publishRun SET active = %d", active ? 1 : 0);
+
+    if (psListLength(where->list)) {
+        psString clause = psDBGenerateWhereConditionSQL(where, NULL);
+        psStringAppend(&query, "\n AND %s", clause);
+        psFree(clause);
+    }
+    psFree(where);
+
+    if (!p_psDBRunQuery(config->dbh, query)) {
+        psError(PS_ERR_UNKNOWN, false, "Database error");
+        psFree(query);
+        return false;
+    }
+    psFree(query);
+
+    long numUpdated = psDBAffectedRows(config->dbh);
+    psLogMsg("pubtool", PS_LOG_INFO, "%ld rows updated.", numUpdated);
 
     return true;
Index: trunk/ippTools/src/pubtool.h
===================================================================
--- trunk/ippTools/src/pubtool.h	(revision 25928)
+++ trunk/ippTools/src/pubtool.h	(revision 25929)
@@ -26,4 +26,5 @@
     PUBTOOL_MODE_NONE      = 0x0,
     PUBTOOL_MODE_DEFINECLIENT,
+    PUBTOOL_MODE_UPDATECLIENT,
     PUBTOOL_MODE_DEFINERUN,
     PUBTOOL_MODE_PENDING,
Index: trunk/ippTools/src/pubtoolConfig.c
===================================================================
--- trunk/ippTools/src/pubtoolConfig.c	(revision 25928)
+++ trunk/ippTools/src/pubtoolConfig.c	(revision 25929)
@@ -50,4 +50,13 @@
     psMetadataAddStr(defineclientArgs, PS_LIST_TAIL, "-comment", 0, "define comment", NULL);
 
+    // -updateclient
+    psMetadata *updateclientArgs = psMetadataAlloc();
+    psMetadataAddStr(updateclientArgs, PS_LIST_TAIL, "-client_id", 0, "search by client_id", NULL);
+    psMetadataAddStr(updateclientArgs, PS_LIST_TAIL, "-stage", 0, "search by stage", NULL);
+    psMetadataAddStr(updateclientArgs, PS_LIST_TAIL, "-product", 0, "search by product", NULL);
+    psMetadataAddStr(updateclientArgs, PS_LIST_TAIL, "-comment", 0, "search by comment (LIKE)", NULL);
+    psMetadataAddBool(updateclientArgs, PS_LIST_TAIL, "-active", 0, "set to active state", NULL);
+    psMetadataAddBool(updateclientArgs, PS_LIST_TAIL, "-inactive", 0, "set to inactive state", NULL);
+
     // -definerun
     psMetadata *definerunArgs = psMetadataAlloc();
@@ -85,4 +94,5 @@
 
     PXOPT_ADD_MODE("-defineclient", "", PUBTOOL_MODE_DEFINECLIENT, defineclientArgs);
+    PXOPT_ADD_MODE("-updateclient", "", PUBTOOL_MODE_UPDATECLIENT, updateclientArgs);
     PXOPT_ADD_MODE("-definerun", "", PUBTOOL_MODE_DEFINERUN, definerunArgs);
     PXOPT_ADD_MODE("-pending", "", PUBTOOL_MODE_PENDING, pendingArgs);
