Browse Source

Minor Fix

old-stable
Mitesh Shah 12 years ago
parent
commit
93b5f2abfb
  1. 27
      setup/engine

27
setup/engine

@ -52,7 +52,7 @@ EngineHelp()
# GET Information Function # GET Information Function
GETINFO() MYSQLINFO()
{ {
# Get The MySQL Username/Password # Get The MySQL Username/Password
@ -79,17 +79,25 @@ GETINFO()
mysql -u $MYSQLUSER -p$MYSQLPASS -e "create database \`$WPDBNAME\`" \ mysql -u $MYSQLUSER -p$MYSQLPASS -e "create database \`$WPDBNAME\`" \
|| OwnError "Unable To Create $WPDBNAME Database" || OwnError "Unable To Create $WPDBNAME Database"
}
WEBUSERINFO()
{
# Nginx User # Nginx User
NGINXUSER=$(grep user /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1) \ NGINXUSER=$(grep user /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1) \
|| OwnError "Unable To Findout Nginx Username" || OwnError "Unable To Findout Nginx Username"
} }
NGINXRELOAD() NGINXRELOAD()
{ {
# Test & Reload Nginx # Test & Reload Nginx
echo -e "\033[34m Reloading Nginx, Please wait... \e[0m" echo -e "\033[34m Reloading Nginx Configuration, Please wait... \e[0m"
nginx -t && service nginx reload || OwnError "Unable To Reload Nginx" nginx -t && service nginx reload || OwnError "Unable To Reload Nginx"
} }
@ -319,12 +327,14 @@ then
if [ "$3" = "all" ] if [ "$3" = "all" ]
then then
# Display The List Of All Sites # Display The List Of All Sites
echo -e "\033[34m List Of All (sites-available) Websites \e[0m"
ls /etc/nginx/sites-available/ \ ls /etc/nginx/sites-available/ \
|| OwnError "Unable To Display The List Of Websites" || OwnError "Unable To Display The List Of Websites"
elif [ "$3" = "active" ] elif [ "$3" = "active" ]
then then
# Display The List Of Active Sites # Display The List Of Active Sites
echo -e "\033[34m List Of Active (sites-enabled) Websites \e[0m"
ls /etc/nginx/sites-enabled/ \ ls /etc/nginx/sites-enabled/ \
|| OwnError "Unable To Display The List Of Active Websites" || OwnError "Unable To Display The List Of Active Websites"
@ -338,6 +348,7 @@ then
then then
# Display The Specific Site Configuration # Display The Specific Site Configuration
echo -e "\033[34m Display The $3 Configuration Settings \e[0m"
cat /etc/nginx/sites-available/$3 \ cat /etc/nginx/sites-available/$3 \
|| OwnError "Unable To Display The $3 Configuration Settings" || OwnError "Unable To Display The $3 Configuration Settings"
fi fi
@ -396,8 +407,8 @@ then
# Removing Wordpress Archive # Removing Wordpress Archive
rm /var/www/$DOMAIN/htdocs/latest.tar.gz rm /var/www/$DOMAIN/htdocs/latest.tar.gz
# Call GETINFO Function For MySQL & Nginx Values # Call MYSQLINFO Function For MySQL Values
GETINFO MYSQLINFO
# Modify wp-config.php # Modify wp-config.php
cp -v /var/www/$DOMAIN/htdocs/wp-config-sample.php \ cp -v /var/www/$DOMAIN/htdocs/wp-config-sample.php \
@ -418,14 +429,16 @@ then
a "$(curl -L https://api.wordpress.org/secret-key/1.1/salt/)" . w \ a "$(curl -L https://api.wordpress.org/secret-key/1.1/salt/)" . w \
| ed -s wp-config.php | ed -s wp-config.php
fi
# Call WEBUSERINFO Function For Web User Details
WEBUSERINFO
# Change Ownership # Change Ownership
echo -e "\033[34m Changing Ownership \e[0m" echo -e "\033[34m Changing Ownership \e[0m"
#echo $NGINXUSER $DOMAIN
chown -R $NGINXUSER:$NGINXUSER /var/www/$DOMAIN/ chown -R $NGINXUSER:$NGINXUSER /var/www/$DOMAIN/
fi
# Reload Nginx Configuration # Reload Nginx Configuration
NGINXRELOAD NGINXRELOAD

Loading…
Cancel
Save