Updated name, added -r, back to Linux

This commit is contained in:
AJ Salkeld
2016-07-16 18:17:04 +01:00
parent 9908daa08d
commit fbaac019ba

View File

@@ -2,7 +2,7 @@
## ##
# File: # File:
# nginx_modsite # nginx-modsite
# Description: # Description:
# Provides a basic script to automate enabling and disabling websites found # Provides a basic script to automate enabling and disabling websites found
# in the default configuration directories: # in the default configuration directories:
@@ -13,7 +13,7 @@
# help dialog displaying all options. # help dialog displaying all options.
## ##
# Copyright (C) 2010 Michael Lustfield <mtecknology@ubuntu.com> # Copyright (C) 2010 Michael Lustfield <mtecknology@ubuntu.com>, 2016 Andrew Salkeld (ajsalkeld) <andrew@ajsalkeld.com>
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
@@ -128,7 +128,11 @@ ngx_sites() {
ngx_reload() { ngx_reload() {
read -p "Would you like to reload the Nginx configuration now? (Y/n) " reload read -p "Would you like to reload the Nginx configuration now? (Y/n) " reload
[[ "$reload" != "n" && "$reload" != "N" ]] && sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist && sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist [[ "$reload" != "n" && "$reload" != "N" ]] && sudo service nginx reload
}
ngx_reload_now() {
sudo service nginx reload
} }
ngx_error() { ngx_error() {
@@ -156,8 +160,8 @@ ngx_help() {
case "$1" in case "$1" in
-e|--enable) ngx_enable_site;; -e|--enable) ngx_enable_site;;
-d|--disable) ngx_disable_site;; -d|--disable) ngx_disable_site;;
-r|--reload) ngx_reload_now;;
-l|--list) ngx_list_site;; -l|--list) ngx_list_site;;
-h|--help) ngx_help;; -h|--help) ngx_help;;
*) ngx_error "No Options Selected" 1; ngx_help;; *) ngx_error "No Options Selected" 1; ngx_help;;
esac esac