fixed vhost assets directory bug
This commit is contained in:
parent
9b8670f4e4
commit
414c063a7c
16
bin/vhost.sh
16
bin/vhost.sh
@ -15,6 +15,18 @@ do
|
|||||||
done
|
done
|
||||||
if [ "$vh" = "y" ]; then
|
if [ "$vh" = "y" ]; then
|
||||||
|
|
||||||
|
# get the current position
|
||||||
|
_cwd="$(pwd)"
|
||||||
|
# check for assets forlder
|
||||||
|
_assets="$_cwd/assets"
|
||||||
|
if [ ! -d "$_assets" ]; then
|
||||||
|
_assets="$_cwd/../assets"
|
||||||
|
if [ ! -d "$_assets" ]; then
|
||||||
|
echo "!! can't find assets directory !!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
while [ "$_domain" = "" ]
|
while [ "$_domain" = "" ]
|
||||||
do
|
do
|
||||||
read -p "enter a hostname ? " _domain
|
read -p "enter a hostname ? " _domain
|
||||||
@ -47,7 +59,7 @@ if [ "$vh" = "y" ]; then
|
|||||||
# lets'encrypt
|
# lets'encrypt
|
||||||
# https://certbot.eff.org/lets-encrypt/debianstretch-nginx
|
# https://certbot.eff.org/lets-encrypt/debianstretch-nginx
|
||||||
if [ "$_letsencrypt" = "yes" ]; then
|
if [ "$_letsencrypt" = "yes" ]; then
|
||||||
apt-get install certbot
|
apt-get --yes --force-yes install certbot
|
||||||
certbot certonly --cert-name "$_domain" --standalone –d "$_domain"
|
certbot certonly --cert-name "$_domain" --standalone –d "$_domain"
|
||||||
openssl dhparam –out /etc/nginx/dhparam.pem 2048
|
openssl dhparam –out /etc/nginx/dhparam.pem 2048
|
||||||
# TODO renewing
|
# TODO renewing
|
||||||
@ -72,7 +84,7 @@ if [ "$vh" = "y" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp "$_cwd"/assets/"$_conffile" /etc/nginx/sites-available/"$_domain".conf
|
cp "$_assets/$_conffile" /etc/nginx/sites-available/"$_domain".conf
|
||||||
sed -ir "s/DOMAIN\.LTD/$_domain/g" /etc/nginx/sites-available/"$_domain".conf
|
sed -ir "s/DOMAIN\.LTD/$_domain/g" /etc/nginx/sites-available/"$_domain".conf
|
||||||
|
|
||||||
mkdir -p /var/www/"$_domain"/public_html
|
mkdir -p /var/www/"$_domain"/public_html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user