- strcpy(cmd, "");
- /*
- * Change directories if specified
- */
- for (a=1; a<argc; ++a) {
- if (!strncmp(argv[a], "-h", 2)) {
- strcpy(bbs_home_directory, argv[a]);
- strcpy(bbs_home_directory, &bbs_home_directory[2]);
- home_specified = 1;
- }
- else {
- if (strlen(cmd)>0) strcat(cmd, " ");
- strcat(cmd, argv[a]);
- }
+/*
+ * Main loop. Do things and have fun.
+ */
+int main(int argc, char **argv)
+{
+ int a;
+ int watchdog = 60;
+ char buf[SIZ];
+ int xfermode = 0;
+ char ctdldir[PATH_MAX]=CTDLDIR;
+
+ /* Parse command line */
+ while ((a = getopt(argc, argv, "h:w:")) != EOF) {
+ switch (a) {
+ case 'h':
+ strncpy(ctdldir, optarg, sizeof ctdldir);
+ break;
+ case 'w':
+ watchdog = atoi(optarg);
+ break;
+ default:
+ fprintf(stderr, "sendcommand: usage: sendcommand [-h server_dir] [-w watchdog_timeout]\n");
+ return(1);