## OpenCA - Command
## (c) 1998-2002 by Massimiliano Pala and OpenCA Group
##
##   File Name: HSMlogout
##       Brief: close a session on the hardware security module
## Description: logout from the hardware security module
##  Parameters: 

sub cmdHsmLogout {

    print startLogPage ("Logout from hardware security module");

    print addLogSection ("The logout command is:");
    my $command = getRequired('HSM_LOGOUT_CMD');
    print addPreLogLine ($command);
    print closeLogSection ();

    print addLogSection ("Run the command ... ");
    my $ret=`$command`;
    if ($? == 0) {
        print addLogLine ("OK");
    } else {
        print addLogLine ("<FONT COLOR=#FF0000>FAILED</FONT>");
        print addPreLogLine ("<FONT COLOR=#FF0000>$ret</FONT>");
    }
    print closeLogSection ();

    print closeLogPage ();

    return 1;
}

1;
