#!/bin/bash
#
# cz-reboot -- Reboot the current system
#
# Written by Bill MacAllister <bill@ca-zephyr.org>
# Copyright (c) 2022 Bill MacAllister <bill@ca-zephyr.org>

case $1 in
  help)
    echo "Usage: dbx-reboot [reboot|help"]
    exit 1
    ;;
  reboot)
    echo 'Rebooting in 5 seconds'
    echo 'sleep 5; reboot' | at now
    ;;
  *)
    echo "Usage: dbx-reboot [reboot|help"]
  ;;
esac

exit

DOCS=<<__END_OF_DOCS__

=head1 NAME

cz-reboot - Reboot the current system

=head1 SYNOPSIS

cz-reboot [reboot|help|manual]

=head1 DESCRIPTION

A very simple wrapper script that is intended to be used as a remctl
target.  In addition to rebooting the target system this script
supplies access to basic documentation.

=head1 OPTIONS

=over 4

=item reboot

Reboot the system immediately.

=item help

Display usage information.

=item manual

Display the man page for this script.

=back

=head1 COPYRIGHT

Copyright (c) 2022 Bill MacAllister <bill@ca-zephyr.org>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

=head1 AUTHORS

Bill MacAllister <whm@dropbox.com>

=cut

__END_OF_DOCS__
#!/bin/bash
#
# cz-reboot -- Reboot the current system
#
# Written by Bill MacAllister <bill@ca-zephyr.org>
# Copyright (c) 2022 Bill MacAllister <bill@ca-zephyr.org>

case $1 in
  help)
    echo "Usage: dbx-reboot [reboot|help"]
    exit 1
    ;;
  reboot)
    echo 'Rebooting in 5 seconds'
    echo 'sleep 5; reboot' | at now
    ;;
  *)
    echo "Usage: dbx-reboot [reboot|help"]
  ;;
esac

exit

DOCS=<<__END_OF_DOCS__

=head1 NAME

cz-reboot - Reboot the current system

=head1 SYNOPSIS

cz-reboot [reboot|help|manual]

=head1 DESCRIPTION

A very simple wrapper script that is intended to be used as a remctl
target.  In addition to rebooting the target system this script
supplies access to basic documentation.

=head1 OPTIONS

=over 4

=item reboot

Reboot the system immediately.

=item help

Display usage information.

=item manual

Display the man page for this script.

=back

=head1 COPYRIGHT

Copyright (c) 2022 Bill MacAllister <bill@ca-zephyr.org>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

=head1 AUTHORS

Bill MacAllister <whm@dropbox.com>

=cut

__END_OF_DOCS__
