--- domainaddtest/hpi_shell/commands.c	2010-09-15 15:35:15.000000000 +0200
+++ did/hpi_shell/commands.c	2010-09-16 13:11:56.000000000 +0200
@@ -1358,29 +1358,57 @@
         if (isdigit(term->term[0]))
                 id = (int)atoi(term->term);
         else {
-                if (strcmp(term->term, "new") != 0) {
-                    return HPI_SHELL_PARM_ERROR;
+	        int cc;
+               	char host[SAHPI_MAX_TEXT_BUFFER_LENGTH + 1];
+	        SaHpiTextBufferT host_tb;
+	        unsigned short port = OPENHPI_DEFAULT_DAEMON_PORT;
+		
+                if (strcmp(term->term, "new") == 0) {
+
+			id = SAHPI_UNSPECIFIED_DOMAIN_ID;
+
+	                cc = get_string_param( "Host: ", host, SAHPI_MAX_TEXT_BUFFER_LENGTH );
+	                if ( cc != 0 ) {
+	                    printf("Invalid host\n");
+	                    return HPI_SHELL_PARM_ERROR;
+	                }
+
+	                host_tb.DataType = SAHPI_TL_TYPE_TEXT;
+	                host_tb.Language = SAHPI_LANG_ENGLISH;
+	                host_tb.DataLength = strlen(host);
+	                memcpy( &host_tb.Data[0], &host[0], host_tb.DataLength );
+
+	                term = get_next_term();
+	                if ( term && isdigit(term->term[0]) ) {
+	                    port = (unsigned short)atoi(term->term);
+	                }
                 }
+		else if (strcmp(term->term, "newid") == 0) {
 
-                int cc;
+			id = SAHPI_UNSPECIFIED_DOMAIN_ID;
 
-                char host[SAHPI_MAX_TEXT_BUFFER_LENGTH + 1];
-                SaHpiTextBufferT host_tb;
-                cc = get_string_param( "Host: ", host, SAHPI_MAX_TEXT_BUFFER_LENGTH );
-                if ( cc != 0 ) {
-                    printf("Invalid host\n");
+	                cc = get_string_param( "Domain-id: ", host, SAHPI_MAX_TEXT_BUFFER_LENGTH );
+	                if ( cc != 0 ) id = SAHPI_UNSPECIFIED_DOMAIN_ID;
+			else id = (int)atoi(host);
+
+	               	cc = get_string_param( "Host: ", host, SAHPI_MAX_TEXT_BUFFER_LENGTH );
+	                if ( cc != 0 ) {
+	                    printf("Invalid host\n");
+	                    return HPI_SHELL_PARM_ERROR;
+	                }
+	                host_tb.DataType = SAHPI_TL_TYPE_TEXT;
+	                host_tb.Language = SAHPI_LANG_ENGLISH;
+	                host_tb.DataLength = strlen(host);
+	                memcpy( &host_tb.Data[0], &host[0], host_tb.DataLength );
+
+	                term = get_next_term();
+	                if ( term && isdigit(term->term[0]) ) {
+	                    port = (unsigned short)atoi(term->term);
+	                }
+		}
+		else {
                     return HPI_SHELL_PARM_ERROR;
-                }
-                host_tb.DataType = SAHPI_TL_TYPE_TEXT;
-                host_tb.Language = SAHPI_LANG_ENGLISH;
-                host_tb.DataLength = strlen(host);
-                memcpy( &host_tb.Data[0], &host[0], host_tb.DataLength );
-
-                unsigned short port = OPENHPI_DEFAULT_DAEMON_PORT;
-                term = get_next_term();
-                if ( term && isdigit(term->term[0]) ) {
-                    port = (unsigned short)atoi(term->term);
-                }
+		}
 
                 printf( "Creating new domain: %s:%u\n", host, port );
                 rv = oHpiDomainAdd( &host_tb, port, &id );
