- Timestamp:
- Apr 29, 2014, 8:22:35 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-tools.c
r3238 r3268 44 44 bool g_remount_cdrom_at_end, ///< TRUE if we unmounted the CD-ROM and should remount it when done with the backup. 45 45 g_remount_floppy_at_end; ///< TRUE if we unmounted the floppy and should remount it when done with the backup. 46 bool g_cd_recovery ; ///< TRUE if we're making an "autonuke" backup.46 bool g_cd_recovery = FALSE; ///< TRUE if we're making an "autonuke" backup. 47 47 double g_kernel_version; 48 48 … … 363 363 char *iso_tmp = NULL; 364 364 char *iso_path = NULL; 365 char *cfg_fname = NULL; 365 366 366 367 assert(bkpinfo != NULL); … … 593 594 594 595 if (bkpinfo->backup_media_type == netfs) { 596 mr_asprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir); 597 write_one_liner_data_file(tmp, bkpinfo->prefix); 598 mr_free(tmp); 599 595 600 if (bkpinfo->netfs_mount) { 596 mr_asprintf(hostname, "%s", bkpinfo->netfs_mount); 601 mr_asprintf(tmp, "%s/NETFS-SERVER-MOUNT", bkpinfo->tmpdir); 602 write_one_liner_data_file(tmp, bkpinfo->netfs_mount); 603 mr_free(tmp); 597 604 } else { 598 605 log_it("netfs_mount is NULL"); 599 606 retval++; 600 mr_asprintf(hostname, ""); 601 } 602 colon = strchr(hostname, ':'); 603 if (!colon) { 604 log_it("netfs mount doesn't have a colon in it"); 605 retval++; 606 } else { 607 struct hostent *hent; 608 609 *colon = '\0'; 610 colon = strchr(hostname, '@'); 611 if (colon) { 612 *colon = '\0'; 613 colon++; 614 hent = gethostbyname(colon); 615 mr_asprintf(bkpinfo->netfs_user,"%s", hostname); 616 } else { 617 hent = gethostbyname(hostname); 618 } 619 if (!hent) { 620 log_it("Can't resolve Network mount (%s): %s", hostname, hstrerror(h_errno)); 621 retval++; 622 } else { 623 mr_asprintf(ip_address, "%s", inet_ntoa((struct in_addr) *((struct in_addr *) hent->h_addr))); 624 mr_strcat(ip_address, strchr(bkpinfo->netfs_mount, ':')); 625 mr_free(bkpinfo->netfs_mount); 626 bkpinfo->netfs_mount = ip_address; 627 } 628 } 629 mr_free(hostname); 630 store_netfs_config(); 607 } 631 608 } 632 609 … … 1028 1005 /** 1029 1006 * Retrieve the line containing @p label from the config file. 1030 * @param config_file The file to read from, usually @c /tmp/mondo -restore.cfg.1007 * @param config_file The file to read from, usually @c /tmp/mondorestore.cfg. 1031 1008 * @param label What to read from the file. 1032 1009 * @param value Where to put it. … … 1251 1228 * Write a line to a configuration file. Writes a line of the form, 1252 1229 * @c label @c value. 1253 * @param config_file The file to write to. Usually @c mondo -restore.cfg.1230 * @param config_file The file to write to. Usually @c mondorestore.cfg. 1254 1231 * @param label What to call this bit of data you're writing. 1255 1232 * @param value The bit of data you're writing.
Note:
See TracChangeset
for help on using the changeset viewer.