Changeset 28088 for main/trunk/greenstone2/bin/script
- Timestamp:
- 2013-08-19T23:36:12+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/activate.pl
r27325 r28088 192 192 return 0; # return false, since the response_code was an error, expected or not 193 193 } 194 else { 195 &print_msg("*** Command $library_url$command\n"); 196 &print_msg("*** Unexpected error. HTTP Response Status: $response_code - Failed.\n"); 197 return 0; 198 } 194 199 } 195 200 } … … 621 626 622 627 &print_msg("Pinging $library_url\n"); 623 if (&ping_library($library_url, $gs_mode, $site)) { # server running628 if (&ping_library($library_url, $gs_mode, $site)) { # server running 624 629 625 630 # server is running, so release the collection if … … 628 633 $is_persistent_server = &is_persistent($library_url, $gs_mode); 629 634 630 if ($is_persistent_server) { # only makes sense to issue activate and deactivate cmds to a persistent server635 if ($is_persistent_server) { # only makes sense to issue activate and deactivate cmds to a persistent server 631 636 632 637 &print_msg("Checking if the collection $qualified_collection is already active\n"); 633 638 my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site); 634 639 635 if ($collection_active) {640 if ($collection_active) { 636 641 &print_msg("De-activating collection $qualified_collection\n"); 637 642 &deactivate_collection($library_url, $gs_mode, $qualified_collection, $site); 638 643 } 639 } 640 } 644 else { 645 &print_msg("Collection is not active => No need to deactivate\n"); 646 } 647 } 648 else { 649 &print_msg("Server is not persistent => No need to deactivate collection\n"); 650 } 651 } 652 else { 653 &print_msg("No response to Ping => Taken to mean server is not running\n"); 654 } 655 641 656 } 642 657 … … 737 752 738 753 &print_msg("Pinging $library_url\n"); 739 if (&ping_library($library_url, $gs_mode, $site)) { # server running754 if (&ping_library($library_url, $gs_mode, $site)) { # server running 740 755 741 756 # don't need to work out persistency of server more than once, since the libraryURL hasn't changed 742 if (!defined $is_persistent_server) {757 if (!defined $is_persistent_server) { 743 758 &print_msg("Checking if Greenstone server is persistent\n"); 744 759 $is_persistent_server = &is_persistent($library_url, $gs_mode); … … 746 761 747 762 748 if ($is_persistent_server) { # persistent server, so can try activating collection763 if ($is_persistent_server) { # persistent server, so can try activating collection 749 764 750 765 &print_msg("Checking if the collection $qualified_collection is not already active\n"); 751 766 my $collection_active = &ping_library_collection($library_url, $gs_mode, $qualified_collection, $site); 752 767 753 if (!$collection_active) {768 if (!$collection_active) { 754 769 &print_msg("Activating collection $qualified_collection\n"); 755 770 &activate_collection($library_url, $gs_mode, $qualified_collection, $site); … … 761 776 } 762 777 } 778 else { 779 &print_msg("Collection is not active => No need to deactivate\n"); 780 } 763 781 } 782 else { 783 &print_msg("Server is not persistent => No need to deactivate collection\n"); 784 } 785 } 786 else { 787 &print_msg("No response to Ping => Taken to mean server is not running\n"); 764 788 } 765 789 }
Note:
See TracChangeset
for help on using the changeset viewer.