Changeset 25596 for main


Ignore:
Timestamp:
2012-05-14T15:54:36+12:00 (12 years ago)
Author:
ak19
Message:
  1. Setting executable permissions on activate.pl for unix-based machines. 2. Only check whether the collection on the server is active after the is-persistent check, because it's not necessary to check whether a collection is active on a server that's not persistent, as there's no point in attempting to deactivate or activate cols on servers that aren't persistent.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/activate.pl

    r25581 r25596  
    539539            # the server is persistent and the collection is active
    540540            &print_msg("Checking if Greenstone server is persistent\n");
    541             $is_persistent_server = &is_persistent($library_url, $gs_mode);
    542            
    543             &print_msg("Checking if the collection $qualified_collection is already active\n");
    544             my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site);
    545            
    546             if($is_persistent_server && $collection_active) {
     541            $is_persistent_server = &is_persistent($library_url, $gs_mode);         
     542           
     543            if($is_persistent_server) { # only makes sense to issue activate and deactivate cmds to a persistent server
     544               
     545                &print_msg("Checking if the collection $qualified_collection is already active\n");
     546                my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site);
     547
     548                if($collection_active) {
    547549                &print_msg("De-activating collection $qualified_collection\n");
    548550                &deactivate_collection($library_url, $gs_mode, $qualified_collection, $site);
     551                }
    549552            }   
    550553        }
     
    608611                }
    609612               
    610                 &print_msg("Checking if the collection $qualified_collection is not already active\n");             
    611                 my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site);                 
    612613                   
    613                 if($is_persistent_server && !$collection_active) {                 
     614                if($is_persistent_server) { # persistent server, so can try activating collection
     615
     616                    &print_msg("Checking if the collection $qualified_collection is not already active\n");
     617                    my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site);
     618
     619                    if(!$collection_active) {
    614620                    &print_msg("Activating collection $qualified_collection\n");
    615621                    &activate_collection($library_url, $gs_mode, $qualified_collection, $site);
     622                    }
    616623                }
    617624            }
Note: See TracChangeset for help on using the changeset viewer.