Skip to content

Add usage to script #1

@kodmanyagha

Description

@kodmanyagha

I think this proxy.sh's feature should be inside of Cpanel but they didn't add this feature still. But no problem, I'm using your script well. But I want to add a small change in this script. Please can you add an "usage" message to script? For example:

#!/bin/bash
echo "========================================================="
echo "==!! cPanel Apache Reverse Proxy !!=="
echo "==!! Usage: proxy.sh {account_username} {subdomain/domain} {local_proxy_path}"
echo "========================================================="
echo ""
DOMAIN=$2
USER=$1
LOCAL=$3

if [[ -z "$USER" ]]; then
    echo "Usage: proxy.sh {account_username} {subdomain/domain} {local_proxy_path}"
    echo "Set a valid cPanel User "
    exit 1
fi

if [[ -z "$DOMAIN" ]]; then
    echo "Usage: proxy.sh {account_username} {subdomain/domain} {local_proxy_path}"
    echo "Set a valid Domain Name"
    exit 1
fi

if [[ -z "$LOCAL" ]]; then
    echo "Usage: proxy.sh {account_username} {subdomain/domain} {local_proxy_path}"
    echo "Set a valid Local Proy Path"
    exit 1
fi

Something like that. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions