} Device;
int verbosity = 0;
+char *post_mount_command = NULL;
/**
Parses a string of the form name=value and places the components in a Property
}
}
+ close(pipe_fd[0]);
if(pid)
waitpid(pid, &status, 0);
gtk_main_quit();
+ if(post_mount_command && !umount)
+ {
+ char workdir[256];
+ int len;
+ len = snprintf(workdir, sizeof(workdir), "/media/%s", device->label);
+ if(len<(int)sizeof(workdir))
+ {
+ if(verbosity>=1)
+ printf("Running %s in %s\n", post_mount_command, workdir);
+
+ pid = fork();
+ if(pid==0)
+ {
+ chdir(workdir);
+ execlp(post_mount_command, post_mount_command, NULL);
+ _exit(1);
+ }
+ }
+ }
+
(void)column;
}
gtk_init(&argc, &argv);
- while((opt = getopt(argc, argv, "vu"))!=-1) switch(opt)
+ while((opt = getopt(argc, argv, "vur:"))!=-1) switch(opt)
{
case 'v':
++verbosity;
case 'u':
umount = 1;
break;
+ case 'r':
+ post_mount_command = optarg;
+ break;
}
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);