- if (!strncasecmp(buf, "bio|", 4)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[4], ctdl_bio_dir);
- }
- else if (!strncasecmp(buf, "files|", 6)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[6], ctdl_file_dir);
- }
- else if (!strncasecmp(buf, "userpics|", 9)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[9], ctdl_usrpic_dir);
- }
- else if (!strncasecmp(buf, "messages|", 9)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[9], ctdl_message_dir);
- }
- else if (!strncasecmp(buf, "netconfigs|", 11)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[11], ctdl_netcfg_dir);
- }
- else if (!strncasecmp(buf, "keys|", 5)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[5], ctdl_key_dir);
- }
- else if (!strncasecmp(buf, "images|", 7)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[7], ctdl_image_dir);
- }
- else if (!strncasecmp(buf, "info|", 5)) {
- snprintf(cmd, sizeof cmd, "rsync -va --rsh='ssh -S %s' %s@%s:%s/ %s/",
- socket_path, remote_user, remote_host, &buf[5], ctdl_info_dir);
+ if (!cmdexit) {
+ printf("\nLocating the remote 'sendcommand' and Citadel installation...\n");
+ snprintf(remote_sendcommand, sizeof remote_sendcommand, "/usr/local/citadel/sendcommand");
+ snprintf(cmd, sizeof cmd, "ssh -S %s %s@%s %s NOOP", socket_path, remote_user, remote_host, remote_sendcommand);
+ cmdexit = system(cmd);
+
+ if (cmdexit) {
+ snprintf(remote_sendcommand, sizeof remote_sendcommand, "/usr/sbin/sendcommand");
+ snprintf(cmd, sizeof cmd, "ssh -S %s %s@%s %s NOOP", socket_path, remote_user, remote_host, remote_sendcommand);
+ cmdexit = system(cmd);