From c524e266f4cd6a478b9363c624649c3e36a2c4bd Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 8 Jul 2013 14:37:28 +0530 Subject: [PATCH] Site Enabel/Disable Features --- etc/bash_completion.d/ee | 8 ++++---- usr/local/sbin/easyengine | 27 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/etc/bash_completion.d/ee b/etc/bash_completion.d/ee index d84752cd..088bd0a4 100644 --- a/etc/bash_completion.d/ee +++ b/etc/bash_completion.d/ee @@ -41,17 +41,17 @@ EEAUTO() site) - COMPREPLY=( $( compgen -W "list listall show info create update delete backup restore" -- $CURRENT ) ) + COMPREPLY=( $( compgen -W "list listall show info create enable disable delete backup restore update" -- $CURRENT ) ) return 0 ;; - show) + show|info|enable) COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) return 0 ;; - info) - COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) + disable) + COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-enabled/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) return 0 ;; diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 7a0233da..d367a167 100755 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -434,7 +434,7 @@ EEDOMAINSETUP() || OwnError "Unable To Create Nginx Configuration File For $DOMAIN" # Creating Symbolic Link - echo -e "\033[34m Creating Symbolic Link \e[0m" + echo -e "\033[34m Creating Symbolic Link For $DOMAIN \e[0m" ln -s /etc/nginx/sites-available/$DOMAIN /etc/nginx/sites-enabled/ \ || OwnError "Unable To Create Symbolic Link For $DOMAIN" @@ -1433,6 +1433,31 @@ then fi fi + elif [ "$2" = "enable" ] + then + + # Check SITENAME Is Empty Or Not + SITENAMECHECK=$3 + EESITENAME + + # Creating Symbolic Link + echo -e "\033[34m Creating Symbolic Link For $DOMAIN \e[0m" + ln -s /etc/nginx/sites-available/$DOMAIN /etc/nginx/sites-enabled/ \ + || OwnError "Unable To Create Symbolic Link For $DOMAIN" + + + elif [ "$2" = "disable" ] + then + + # Check SITENAME Is Empty Or Not + SITENAMECHECK=$3 + EESITENAME + + # Remove Symbolic Link + echo -e "\033[34m Removing Symbolic Link For $DOMAIN \e[0m" + rm /etc/nginx/sites-enabled/$DOMAIN \ + || OwnError "Unable To Remove Symbolic Link For $DOMAIN" + #elif [ "$2" = "delete" ] #then