=head1 NAME

ngcp-check-active - check whether the system is the active HA node

=head1 SYNOPSIS

B<ngcp-check-active> [I<option>...]

=head1 DESCRIPTION

This program checks whether the system is currently the active HA node.
It reports the node status with the exit status and possibly by also printing
it on standard output, in verbose or abbreviated forms, depending on the
options.

If standard output is connected to a terminal, the default output mode is
B<--verbose>, otherwise the default output mode is B<--quiet>.

=head1 OPTIONS

=over 4

=item B<-p>, B<--prompt>

Set the output mode to one-character status for prompt inclusion.

=item B<-v>, B<--verbose>

Set the output mode to a descriptive status name.

=item B<-q>, B<--quiet>

Set the output mode to be quiet, and the status will only be returned by
the exit status.

=item B<-h>, B<--help>

Display a help text and exit.

=back

=head1 EXIT STATUS

The exit code represents the current node state.

=over 4

=item B<0>

This is the B<active> (B<!>) HA node.

=item B<1>

This is the B<standby> (B<.>) HA node.

=item B<2>

The node state is B<unknown> (B<?>), or some error occurred while retrieving
the state.

=back

=head1 SEE ALSO

B<ngcp-make-active>(8), B<ngcp-make-standby>(8).

=head1 BUGS AND LIMITATIONS

Please report problems you notice to the Sipwise
Development Team <support@sipwise.com>.

=head1 AUTHOR

Guillem Jover <gjover@sipwise.com>

=head1 LICENSE

Copyright (C) 2020-2023 Sipwise GmbH, Austria

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
