Ignore:
Timestamp:
May 29, 2008, 5:40:05 PM (9 years ago)
Author:
bruno
Message:
  • Remove all references to /root/images
  • Fix the lack of support for options in mondorestore by copying what is done for mondoarchive and sharing the functions analyzing the cli (getopt usage)
  • Review the now common handle_incoming_parameters to have it support correctly 2 modes (archiving and restoring)
  • Update mondorestore man page to take in account the options supported now
  • Replace mondorestore options --nuke, --interactive, with -Z nuke, -Z interactive ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/mondorestore/mondorestore.c

    r1966 r1967  
    31603160        finish(res);
    31613161    }
    3162        
     3162
    31633163    if ((argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) && (!bkpinfo->disaster_recovery)) {
    31643164        g_restoring_live_from_cd = TRUE;
     
    32053205
    32063206        // BCO:To be reviewed
    3207         if (argc > 1
    3208             && (strcmp(argv[1], "--compare") == 0
    3209                 || strcmp(argv[1], "--nuke") == 0)) {
     3207        if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) {
    32103208            if (bkpinfo->backup_media_type == nfs
    32113209                && !is_this_device_mounted(bkpinfo->nfs_mount)) {
     
    32273225
    32283226
    3229         if (argc == 2 && strcmp(argv[1], "--nuke") == 0) {
     3227        if (bkpinfo->restore_mode == nuke) {
    32303228            iamhere("nuking");
    32313229            retval += nuke_mode(mountlist, raidlist);
    3232         } else if (argc == 2 && strcmp(argv[1], "--interactive") == 0) {
     3230        } else if (bkpinfo->restore_mode == interactive) {
    32333231            iamhere("catchall");
    32343232            retval += catchall_mode(mountlist, raidlist);
    3235         } else if (argc == 2 && strcmp(argv[1], "--compare") == 0) {
     3233        } else if (bkpinfo->restore_mode == compare) {
    32363234            iamhere("compare");
    32373235            retval += compare_mode(mountlist, raidlist);
    3238         } else if (argc == 2 && strcmp(argv[1], "--iso") == 0) {
     3236        } else if (bkpinfo->restore_mode == isoonly) {
    32393237            iamhere("iso");
    32403238            retval = iso_mode(mountlist, raidlist, FALSE);
    3241         } else if (argc == 2 && strcmp(argv[1], "--mbr") == 0) {
     3239        } else if (bkpinfo->restore_mode == mbr) {
    32423240            iamhere("mbr");
    32433241            retval = mount_all_devices(mountlist, TRUE);
     
    32493247                log_to_screen("Failed to write Master Boot Record");
    32503248            }
    3251         } else if (argc == 2 && strcmp(argv[1], "--isonuke") == 0) {
     3249        } else if (bkpinfo->restore_mode == isonuke) {
    32523250            iamhere("isonuke");
    32533251            retval = iso_mode(mountlist, raidlist, TRUE);
    3254         } else if (argc != 1) {
    3255             log_to_screen("Invalid paremeters");
    3256             paranoid_MR_finish(1);
    32573252        } else {
    32583253            iamhere("catchall (no mode specified in command-line call");
Note: See TracChangeset for help on using the changeset viewer.