Bugfix bash
This commit is contained in:
parent
4a59811f82
commit
c2c5adbd45
4
admin.sh
4
admin.sh
|
@ -7,11 +7,11 @@ for byod in /home/*/byod; do
|
||||||
domain=$(cat $byod)
|
domain=$(cat $byod)
|
||||||
echo "$user is requesting $domain"
|
echo "$user is requesting $domain"
|
||||||
if [ -s /etc/nginx/sites-enabled/byod-$user-$domain.conf ]; then
|
if [ -s /etc/nginx/sites-enabled/byod-$user-$domain.conf ]; then
|
||||||
echo "byod already configured for $user and $domain"
|
echo "byod already configured for $user at $domain"
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
domainip=$(dig +short a $domain)
|
domainip=$(dig +short a $domain)
|
||||||
if [ "$bestip" == "$domainip"]
|
if [ "$bestip" == "$domainip" ]
|
||||||
then
|
then
|
||||||
sed -e "s/<user>/$user/" -e "s/<domain>/$domain/" template.conf \
|
sed -e "s/<user>/$user/" -e "s/<domain>/$domain/" template.conf \
|
||||||
> /etc/nginx/sites-available/byod-$user-$domain.conf
|
> /etc/nginx/sites-available/byod-$user-$domain.conf
|
||||||
|
|
Loading…
Reference in New Issue