Annotation of freem/scripts/fmd-docupdate, revision 1.2

1.1       snw         1: #!/usr/bin/env bash
                      2: 
                      3: #
1.2     ! snw         4: #   $Id: fmd-docupdate,v 1.1 2025/04/05 03:18:41 snw Exp $
1.1       snw         5: #    Upload the current documentation to the FreeM website
                      6: #
                      7: #  
                      8: #   Author: Serena Willis <snw@coherent-logic.com>
                      9: #    Copyright (C) 1998 MUG Deutschland
                     10: #    Copyright (C) 2025 Coherent Logic Development LLC
                     11: #
                     12: #
                     13: #   This file is part of FreeM.
                     14: #
                     15: #   FreeM is free software: you can redistribute it and/or modify
                     16: #   it under the terms of the GNU Affero Public License as published by
                     17: #   the Free Software Foundation, either version 3 of the License, or
                     18: #   (at your option) any later version.
                     19: #
                     20: #   FreeM is distributed in the hope that it will be useful,
                     21: #   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     22: #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     23: #   GNU Affero Public License for more details.
                     24: #
                     25: #   You should have received a copy of the GNU Affero Public License
                     26: #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
                     27: #
1.2     ! snw        28: #   $Log: fmd-docupdate,v $
        !            29: #   Revision 1.1  2025/04/05 03:18:41  snw
        !            30: #   Add fmd docupdate command to dev scripts
        !            31: #
1.1       snw        32: #
                     33: # SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
                     34: # SPDX-License-Identifier: AGPL-3.0-or-later
                     35: #
                     36: 
                     37: 
                     38: PGM=$(basename $0)
                     39: 
                     40: function usage() {
1.2     ! snw        41:     echo
        !            42:     echo "Uploads current documentation to the FreeM website"
        !            43:     echo
        !            44:     echo "usage:"
        !            45:     echo
        !            46:     echo "   fmd docupdate <ssh-server>"
        !            47:     echo
        !            48:     echo " The <ssh-server> argument should be in the format 'username@fqdn'."
        !            49:     echo " Do NOT specify anything else."
        !            50:     echo
        !            51:     exit 0
1.1       snw        52: }
                     53: 
1.2     ! snw        54: if [[ $1 == "help" ]]
        !            55: then
        !            56:     usage
        !            57: fi
1.1       snw        58: 
                     59: if [[ $# == 0 ]]
                     60: then
                     61:     echo "fmd-docupdate:  must be run from 'fmd docupdate'"
                     62:     exit 1
                     63: fi
                     64: 
                     65: NEWVER=$(cat sem.ver)
                     66: 
                     67: if [[ $# != 2 ]]
                     68: then
                     69:     usage
                     70: fi
                     71: 
                     72: SSHCRED=$2
                     73: 
                     74: cd doc/
                     75: ./crdocs.sh
                     76: 
                     77: DOCDIR="//var/www/freem.coherent-logic.com/docs/${NEWVER}/"
                     78: 
                     79: ssh "${SSHCRED}" "mkdir ${DOCDIR}"
                     80: if [[ $? != 0 ]]
                     81: then
                     82:     echo "${PGM}:  error creating remote directory"
                     83:     exit 1
                     84: fi
                     85: 
                     86: scp freem.texi freem/*.html freem.ps freem.pdf freem.info.gz "${SSHCRED}:${DOCDIR}/"
                     87: if [[ $? != 0 ]]
                     88: then
                     89:     echo "${PGM}:  error copying docs"
                     90:     exit 1
                     91: fi
                     92: 
                     93: make -f Makefile.orig clean

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>