�&ǐk�@'bJ�h�ۊL'}T� :��'2�Z#$��n�a��� �>a��`��_3d�Qpt�/�P -��#5�,�M��� �pA:©�q�����NW��ډ�A���� �9nʺج���� �TSM��{J6?7��r�@�\����D��� �׶���s�f�TJj?"��D��`?��̒� b�#�%�C*v�$�{�$����5Ծ�F�s��y�e/8��h-�f�̰&(����Gj�L:U� 2�� ����v�_k����Y��gp,�k�WF�R������_C�R��N@���R�@�ߔ?A�w9���F("iNa-S���Q�o�3tDMLh*�#4k�T/iQ��Y*�G��m����)��8�hBm/�I�,g�ﯖ���Z��}�Cz�q@´��d.����L�ŕ�,��1�Z�܌�: ̪���F+J-'��c�tvJ8��]Q-��b��y �6;*J`r_�d ��'�G ~p��)'�C,�%F��E(��2�k�����lР�z�!�=t ��_�0��f7��� ;�p�|�U �%new(); my $has_active_license = 0; # Retrieve the license from the store server my ( $rc, $serial_no ) = $handler->get_litespeed_license(); # If there is no active license available, there is no need to continue, otherwise we'll save the serial number from the license server if ( $rc == 1 ) { $has_active_license = 1; } else { # No active license exists, no need to carry on print "No license found for LiteSpeed Web Server in cPanel Store.\n"; return 0; } # If it's installed (at least in some fashion) we need to check to see if it's using the right license. # For example, if they are using a TRIAL key, or expired key, we want to replace it with the latest available # If it's not installed and we have a valid serial, install LS with the serial my $is_installed = $handler->is_litespeed_installed(); if ($is_installed) { my ( $rc, $stdout, $stderr ) = $handler->ensure_using_latest_license($serial_no); if ( $rc == 1 ) { print "Successfully installed new license on existing install:\n$stdout\n"; my ( $rc2, $stdout2, $stderr2 ) = $handler->lsws_cmd('SWITCH_TO_LSWS'); if ( $rc2 == 1 ) { print "Successfully ensured LiteSpeed Web Server is the default.\n"; } else { print "There was a problem trying to enable LiteSpeed Web Server:\n$stdout2\n$stderr2\n"; } } elsif ( $rc == 2 ) { print "Valid license already in place on existing install\n"; } else { print "Failed to install new license on existing install:\n$stdout\n$stderr\n"; } } else { if ( $handler->install_litespeed( { 'quiet' => 1, 'license_key' => $serial_no } ) ) { print "Successfully installed LiteSpeed Web Server with new license.\n"; } } return 0; } ###[ Functions ]######################################################################################################## sub show_usage { my ($use_stderr) = @_; my $out_fh = ( $use_stderr ? \*STDERR : \*STDOUT ); print $out_fh < --help : Show this output --run : Actually run the check for LiteSpeed license and installation EOF return; }