* Hopefully fixed spacing

* Added --servicename argument
This commit is contained in:
Lutchy Horace 2021-11-09 08:20:22 -05:00
parent 97199fc9f5
commit d241024593
1 changed files with 21 additions and 15 deletions

View File

@ -21,6 +21,8 @@ function usage
echo " Description of VHosts"
echo " --denotredirect"
echo " Do not redirect HTTP to HTTPS"
echo " --servicename"
echo " The Nginx server service name to use to reload"
echo " -d | --debug"
echo " Enable debug logging"
echo " -h | --help"
@ -42,8 +44,8 @@ function get_cert
function reload_nginx
{
echo -n "Reloading Nginx..."
if systemctl reload nginx > /dev/null 2>&1; then
echo -n "Reloading ${_servicename}..."
if systemctl reload ${_servicename} > /dev/null 2>&1; then
echo "Success"
else
echo "Failed"
@ -109,7 +111,7 @@ fi
# gain priviledges
become "$@"
OPTS=$(getopt -o h,d -l domain:,root:,backend:,listenip:,desc:,donotredirect,debug -n 'createVhosts' -- "$@")
OPTS=$(getopt -o h,d -l domain:,root:,backend:,listenip:,desc:,donotredirect,servicename:,debug -n 'createVhosts' -- "$@")
if [ "$?" -gt '0' ]; then
echo 'Failed to set command line arguments'
exit 1;
@ -123,6 +125,7 @@ _root=""
_backend=""
_listenip=""
_debug=false
_servicename=nginx
while true; do
case "$1" in
--domain )
@ -143,6 +146,9 @@ while true; do
--donotredirect )
_donotredirect=true
shift ;;
--servicename )
_servicename=$2
shift ;;
-d | --debug )
_debug=true
shift ;;