Only in gnut-0.4.13-patched: Makefile
Only in gnut-0.4.13-patched: config.cache
Only in gnut-0.4.13-patched: config.log
Only in gnut-0.4.13-patched: config.status
Only in gnut-0.4.13-patched/doc: Makefile
Only in gnut-0.4.13-patched/macros: Makefile
Only in gnut-0.4.13-patched/src: "poop"
Only in gnut-0.4.13-patched/src: Gnut_Hash.o
Only in gnut-0.4.13-patched/src: Gnut_List.o
Only in gnut-0.4.13-patched/src: Gnut_Queue.o
Only in gnut-0.4.13-patched/src: Makefile
Only in gnut-0.4.13-patched/src: blacklist.o
Only in gnut-0.4.13-patched/src: cache.o
Only in gnut-0.4.13-patched/src: cgi_parse.o
diff -ur gnut-0.4.13/src/cli_input.c gnut-0.4.13-patched/src/cli_input.c
--- gnut-0.4.13/src/cli_input.c	Sat Aug 12 20:43:50 2000
+++ gnut-0.4.13-patched/src/cli_input.c	Sun Sep 17 00:16:03 2000
@@ -64,11 +64,12 @@
 int com_blacklist(char *), com_clear(char *), com_cls(char *),
   com_debug(char *), com_find(char *), com_get(char *),
   com_help(char *), com_hosts(char *), com_info(char *),
-  com_kill(char *), com_limit(char *), com_log(char *),
-  com_monitor(char *), com_mpush(char *), com_mreply(char *),
-  com_open(char  *), com_play(char *), com_player(char *),
-  com_push(char *), com_quit(char *), com_response(char *),
-  com_scan(char *), com_search(char *), com_set(char *), 
+  com_kill(char *), com_limit(char *), com_load(char *),
+  com_log(char *), com_monitor(char *), com_mpush(char *),
+  com_mreply(char *), com_open(char  *), com_pipe(char *),
+  com_play(char *), com_player(char *), com_push(char *),
+  com_quit(char *), com_response(char *), com_save(char *),
+  com_scan(char *), com_search(char *), com_set(char *),
   com_share(char *), com_shell(char *), com_sleep(char *),
   com_stop(char *), com_update(char *), com_version(char *);
 
@@ -84,11 +85,14 @@
   {"info",   com_info,   "Display various information." },
   {"kill",  com_kill,  "Terminate connection(s)." },
   {"limit",  com_limit,  "Impose bandwidth limits on transfers." },
+  {"load",  com_load, "Load a configuration file." },
   {"log",    com_log,  "Set logging level." },
   {"monitor",  com_monitor,  "Monitor search requests."},
   {"mpush",  com_mpush,  "Monitor push requests routed to others."},
   {"mreply",  com_mreply,  "Monitor search replies routed to others."},
   {"open",   com_open,   "Open a new connection." },
+  {"|",		com_pipe,	"Executes the output of a shell command." },
+  {"pipe",	com_pipe,	"Synonym for '|'." },
   {"play",  com_play,  "Start play_prog on selected queries."},
   {"player", com_player, "Player for downloads"},
   {"push",  com_push,  "Request a push connection."},
@@ -99,6 +103,7 @@
   {"set",    com_set,  "Change configuration values." },
   {"share",  com_share,  "Set share paths." },
   {"!",		com_shell,	"Executes a command or drops to shell." },
+  {"save",  com_save,  "Save config to specified file."},
   {"sleep",  com_sleep,  "Sleep for n seconds."},
   {"stop",  com_stop,  "Stop transfer(s)." },
   {"update",  com_update,  "Update the current host list." },
@@ -261,7 +266,7 @@
       parse_command(buf);
     }
   }
-  
+  fclose(fp);
   return 0;
 }
 
@@ -1490,6 +1495,18 @@
   return 0;
 }
 
+int com_load(char *arg)
+{
+	char *buf = NULL;
+	if (arg) {
+		buf = expand_path(arg);
+		printf("Loading config file \"%s\".\n", buf);
+		run_config_file(buf,1);
+		xfree(buf);
+	}
+	return 0;
+}
+
 int com_share(char *arg)
 {
   if (arg) {
@@ -2084,4 +2101,88 @@
 #else
   return 0;
 #endif
+}
+
+int com_pipe(char *arg)
+{
+	FILE *p = NULL;
+	char buf[1024] = "";
+#ifndef WIN32
+	if (arg)	{
+		p = popen(arg,"r");
+		if (!p) return -1;
+		while (fgets(buf,sizeof(buf),p)) {
+			if (buf[strlen(buf)-1]=='\n') buf[strlen(buf)-1]=0;
+			if (buf[strlen(buf)-1]=='\r') buf[strlen(buf)-1]=0;
+      		parse_command(buf);
+		}
+		pclose(p);
+	}
+#endif
+	return 0;
+}
+
+int cli_save_conf(void *a, void *b)
+{
+	conf_key_pair *ckp = a;
+	FILE *file = b;
+
+	if (!strcmp(ckp->key,"update_guid")) return 0;
+	if (!strcmp(ckp->key,"query_guid")) return 0;
+	if (!strcmp(ckp->key,"mac")) return 0;
+	if (!strcmp(ckp->key,"guid")) return 0;
+
+	fprintf(file,"set %s %s\n",ckp->key,ckp->val);
+	return 0;
+}
+
+int com_save(char *arg)
+{
+	struct stat  stats;
+	FILE *file = NULL;
+	char *cfg = NULL,
+	     *tmp = NULL;
+
+	/* save config strings */
+	if (!arg)	{
+		tmp = conf_get_str("config_file");
+		if (!tmp||!strlen(tmp))	{
+			printf("Undefined configuration file (config string \"config_file\").\nPlease see the manual for more information\n");
+			return 0;
+		}
+		cfg = expand_path(tmp);
+	} else {
+		cfg = expand_path(arg);
+	}
+
+	if (stat(cfg,&stats)!=-1)	{
+		printf("Replacing existing file \"%s\".\n", cfg);
+	} else {
+		printf("Creating file \"%s\".\n", cfg);
+	}
+	file = fopen(cfg,"w");
+	if (!file)	{
+		printf("Couldn't open file \"%s\" for writing.\n", cfg);
+		return 0;
+	} 
+
+	gnut_hash_foreach(conf_hash, cli_save_conf, file);
+	tmp = conf_get_str("share_paths");
+	if (tmp&&strlen(tmp))	{
+		fprintf(file,"scan\n");
+	}
+	fflush(file);
+	fclose(file);
+	free(cfg);
+
+	/* save hosts */
+  	tmp = expand_path("~/.gnut_hosts");
+	host_save(tmp);
+	xfree(tmp);
+
+	/* save blacklists */
+	if (gnut_blacklist_totals())
+		gnut_blacklist_save();
+	
+	return 0;
 }
Only in gnut-0.4.13-patched/src: cli_input.c.new
Only in gnut-0.4.13-patched/src: cli_input.o
Only in gnut-0.4.13-patched/src: cli_interface.o
Only in gnut-0.4.13-patched/src: cli_output.o
Only in gnut-0.4.13-patched/src: cli_readline.o
diff -ur gnut-0.4.13/src/conf.c gnut-0.4.13-patched/src/conf.c
--- gnut-0.4.13/src/conf.c	Sat Aug 12 17:50:49 2000
+++ gnut-0.4.13-patched/src/conf.c	Sun Sep 17 00:08:26 2000
@@ -21,6 +21,7 @@
   {"cache_path",      ""},
   {"cache_refresh",   "600"},
   {"cache_size",      "15000"},  /* 15 megs.  Should this be measured in M instead of K? */
+  {"config_file",     ""},
   {"debug_opts",      "0"},
   {"default_download_cap", "0"},
   {"default_upload_cap", "0"},
Only in gnut-0.4.13-patched/src: conf.o
Only in gnut-0.4.13-patched/src: gnut
Only in gnut-0.4.13-patched/src: gnut.o
Only in gnut-0.4.13-patched/src: gnut_connection.o
Only in gnut-0.4.13-patched/src: gnut_http.o
Only in gnut-0.4.13-patched/src: gnut_if.o
Only in gnut-0.4.13-patched/src: gnut_lib.o
Only in gnut-0.4.13-patched/src: gnut_net.o
Only in gnut-0.4.13-patched/src: gnut_threads.o
Only in gnut-0.4.13-patched/src: gnut_transfer.o
Only in gnut-0.4.13-patched/src: host.o
Only in gnut-0.4.13-patched/src: http_core.o
Only in gnut-0.4.13-patched/src: http_header.o
Only in gnut-0.4.13-patched/src: monitor.o
Only in gnut-0.4.13-patched/src: player.o
Only in gnut-0.4.13-patched/src: poop
Only in gnut-0.4.13-patched/src: prompt.o
Only in gnut-0.4.13-patched/src: protocol.o
Only in gnut-0.4.13-patched/src: query.o
Only in gnut-0.4.13-patched/src: route.o
Only in gnut-0.4.13-patched/src: share.o
Only in gnut-0.4.13-patched/src: share_cache.o
Only in gnut-0.4.13-patched/src/win32pth: Makefile

