mirror of
https://github.com/hwdsl2/openvpn-install.git
synced 2024-07-05 03:05:52 +02:00
Add usage
This commit is contained in:
parent
0e2fd697a6
commit
b07d70376e
@ -112,6 +112,23 @@ new_client() {
|
||||
chmod 600 "$export_dir$client".ovpn
|
||||
}
|
||||
|
||||
show_usage() {
|
||||
if [ -n "$1" ]; then
|
||||
echo "Error: $1" >&2
|
||||
fi
|
||||
cat 1>&2 <<EOF
|
||||
|
||||
Usage: bash $0 [options]
|
||||
|
||||
Options:
|
||||
--auto auto install OpenVPN using default options
|
||||
-h, --help show this help message and exit
|
||||
|
||||
To customize install options, run this script without arguments.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
ovpnsetup() {
|
||||
|
||||
# Detect Debian users running the script with "sh" instead of bash
|
||||
@ -207,9 +224,11 @@ if [[ ! -e /etc/openvpn/server/server.conf ]]; then
|
||||
auto=1
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
show_usage
|
||||
;;
|
||||
*)
|
||||
echo "Unknown parameter: $1" >&2
|
||||
exit 1
|
||||
show_usage "Unknown parameter: $1"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user