From 1b45ab6586a3762d2f9b60290b097542fd8bf98c Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Fri, 10 Mar 2023 17:13:26 -0800 Subject: [PATCH] add help() --- wg-client-add.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wg-client-add.sh b/wg-client-add.sh index b0840cb..0debf45 100755 --- a/wg-client-add.sh +++ b/wg-client-add.sh @@ -6,6 +6,25 @@ # Copyright (c) 2022 Matthew Saunders Brown # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# load include file +source $(dirname $0)/wg.sh + +help() +{ + thisfilename=$(basename -- "$0") + echo "Add virtualhost to this server." + echo "" + echo "usage: $thisfilename -d -u [-h]" + echo "" + echo " -h Print this help." + echo " -d Domain name to add as a VirtualHost. www. subdomain is automatically aliased." + echo " -u Username to install VirtualHost for. Username must already exist." + echo " If need be run vhost-user-add.sh first." + echo " Or use vhost-deploy.sh instead to automatically generate username." +} + +vhost:getoptions "$@" + # require root if [ "${EUID}" -ne 0 ]; then echo "This script must be run as root"