From 86350fc1838d939866eb110a706d33112e538a2c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sat, 19 May 2018 15:56:46 +0200 Subject: [PATCH] man: allow to enroll and install man pages Support was missing for quite a while. Time to write a couple of docs for our "opnsense-" tools in core. --- Mk/tree.mk | 10 +++++- plist | 1 + src/Makefile | 3 +- src/man/man8/opnsense-importer.8 | 56 ++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 src/man/man8/opnsense-importer.8 diff --git a/Mk/tree.mk b/Mk/tree.mk index aff661ded..0b69e98a8 100644 --- a/Mk/tree.mk +++ b/Mk/tree.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2017 Franco Fichtner +# Copyright (c) 2015-2018 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -78,6 +78,11 @@ install-${TARGET}: "${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE%%.shadow}.sample"; \ fi; \ fi; \ + if [ "${TREE}" = "man" ]; then \ + gzip -vcn "${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE}" > \ + "${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE}.gz"; \ + rm "${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE}"; \ + fi; \ done .endfor @@ -96,6 +101,9 @@ plist-${TARGET}: FILE="$${FILE%%.sample}"; \ FILE="$${FILE%%.shadow}"; \ fi; \ + if [ "${TREE}" == "man" ]; then \ + FILE="$${FILE}.gz"; \ + fi; \ echo "$${PREFIX}${ROOT_${TARGET}}/${TREE}/$${FILE}"; \ done .endfor diff --git a/plist b/plist index 0eee5c861..bed011714 100644 --- a/plist +++ b/plist @@ -1001,6 +1001,7 @@ /usr/local/sbin/ppp-linkup /usr/local/sbin/ppp-log-uptime.sh /usr/local/sbin/ppp-uptime.sh +/usr/local/share/man/man8/opnsense-importer.8.gz /usr/local/wizard/openvpn.xml /usr/local/wizard/system.xml /usr/local/www/carp_status.php diff --git a/src/Makefile b/src/Makefile index 418fb093d..ad33a47d4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,7 @@ -TREES= boot etc opnsense sbin wizard www +TREES= boot etc man opnsense sbin wizard www ROOT= /usr/local ROOT_boot= / +ROOT_man= /usr/local/share EXTRAS= bootstrap TREES_bootstrap=etc/pkg diff --git a/src/man/man8/opnsense-importer.8 b/src/man/man8/opnsense-importer.8 new file mode 100644 index 000000000..86a70e755 --- /dev/null +++ b/src/man/man8/opnsense-importer.8 @@ -0,0 +1,56 @@ +.\" +.\" Copyright (c) 2018 Franco Fichtner +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd May 19, 2018 +.Dt OPNSENSE-IMPORTER 8 +.Os +.Sh NAME +.Nm opnsense-importer +.Nd OPNsense import utility +.Sh SYNOPSIS +.Nm +.Op Fl b +.Sh DESCRIPTION +The +.Nm +utility can import a previous configuration from multiple types of +disk formats. +If successful, the old configuration will be replaced. +.Pp +The options are as follows: +.Bl -tag -width ".Fl b" -offset indent +.It Fl b +Run the importer in bootstrap mode, which only triggers the import +timeout prompt when no current configuration is found in the system. +This mode is used for install media duties to allow early configuration +imports to allow to live-boot into them. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr opnsense-installer 8 +.Sh AUTHORS +.An Franco Fichtner Aq Mt franco@opnsense.org