StopServer.pm (BackupPC-4.3.2) | : | StopServer.pm (BackupPC-4.4.0) | ||
---|---|---|---|---|
skipping to change at line 30 | skipping to change at line 30 | |||
# This program is distributed in the hope that it will be useful, | # This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | # GNU General Public License for more details. | |||
# | # | |||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | |||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
# | # | |||
#======================================================================== | #======================================================================== | |||
# | # | |||
# Version 4.3.2, released 17 Feb 2020. | # Version 4.4.0, released 20 Jun 2020. | |||
# | # | |||
# See http://backuppc.sourceforge.net. | # See http://backuppc.sourceforge.net. | |||
# | # | |||
#======================================================================== | #======================================================================== | |||
package BackupPC::CGI::StopServer; | package BackupPC::CGI::StopServer; | |||
use strict; | use strict; | |||
use BackupPC::CGI::Lib qw(:all); | use BackupPC::CGI::Lib qw(:all); | |||
sub action | sub action | |||
{ | { | |||
if ( defined($bpc) && $bpc->ServerOK() ) { | if ( defined($bpc) && $bpc->ServerOK() ) { | |||
$bpc->ServerMesg("log User $User requested server shutdown"); | $bpc->ServerMesg("log User $User requested server shutdown"); | |||
$bpc->ServerMesg("server shutdown"); | $bpc->ServerMesg("server shutdown"); | |||
for ( my $i = 0; $i < 10; $i++ ) { | for ( my $i = 0 ; $i < 10 ; $i++ ) { | |||
last unless $bpc->ServerOK(); | last unless $bpc->ServerOK(); | |||
sleep(1); | sleep(1); | |||
} | } | |||
sleep(2); | sleep(2); | |||
} | } | |||
print $Cgi->redirect($MyURL); | print $Cgi->redirect($MyURL); | |||
} | } | |||
1; | 1; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |