diff --git a/etc/bash_completion.d/ee b/etc/bash_completion.d/ee index 36120b28..f51eb9e7 100644 --- a/etc/bash_completion.d/ee +++ b/etc/bash_completion.d/ee @@ -33,7 +33,7 @@ EEAUTO() ;; site) - COMPREPLY=( $( compgen -W "list show info create enable disable delete" -- $CURRENT ) ) + COMPREPLY=( $( compgen -W "list show info create enable disable delete edit" -- $CURRENT ) ) return 0 ;; @@ -54,6 +54,13 @@ EEAUTO() fi return 0 ;; + edit) + if [ "$EECOMMON" = "site" ] + then + COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) + fi + return 0 + ;; disable) COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2>/dev/null)' -- $CURRENT ) ) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 553cd92e..366b5083 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -844,6 +844,13 @@ EESITEINFO() echo -e "\033[34m$DOMAIN Database:\t\t \033[37m$WPDBNAME\e[0m" } +EESITEEDIT() +{ + # Run default editor on /etc/nginx/sites-available/$DOMAIN + sensible-editor /etc/nginx/sites-available/$DOMAIN + echo -e "\033[34VirtualHost updated..\e[0m" +} + NGINXBUCKETSIZE() { nginx -t 2>&1 | grep server_names_hash_bucket_size &>> $INSTALLLOG @@ -884,7 +891,7 @@ PHPRESTART() -# EE Domian Functions +# EE Domain Functions EESITENAME() { # Check SITENAME Is Empty Or Not @@ -2187,7 +2194,25 @@ then EEGITMESSAGE="Delete Website With $SITEDELETEARG Option: $DOMAIN" EEGITCOMMIT - fi + elif [ "$2" = "edit" ] + then + + # Check SITENAME Is Empty Or Not + SITENAMECHECK=$3 + EESITENAME + + # Run editor + EESITEEDIT + + # Reload Nginx Configuration + NGINXRELOAD + + # Take Nginx Configuration In Git Version Control + EEGITDIR=/etc/nginx + EEGITMESSAGE="Edited Website: $DOMAIN" + EEGITCOMMIT + + fi else echo -e "\033[34mList Of Available Commands:\e[0m" @@ -2197,9 +2222,9 @@ then echo -e "\tcreate:\t Create A New HTML PHP MySQL & WordPress Website" echo -e "\tdelete:\t Delete Existing Website" echo -e "\tenable:\t Enable Website" - echo -e "\tdisable: Disable Website" - fi + echo -e "\tedit: Manually Edit Website" + fi elif [ "$1" = "update" ] then