Do not fail with former setup #2

Manually merged
den merged 2 commits from southerntofu/byod:master into master 2019-08-14 17:35:31 +00:00
1 changed files with 2 additions and 2 deletions

View File

@ -2,13 +2,13 @@
bestip=$(dig +short a tilde.best)
[! -d /var/lib/byod] && mkdir /var/lib/byod
[! -d /var/lib/byod] && mkdir /var/lib/byod && mkdir /var/lib/byod/user && mkdir /var/lib/byod/domain
for byod in /home/*/byod; do
user=$(stat -c '%U' $byod)
domain=$(cat $byod)
echo "$user is requesting $domain"
if [ -s /etc/nginx/sites-enabled/byod-$domain.conf ]; then
if [ -f /var/lib/byod/$domain ]; then
echo "byod already configured for $domain"
previousUser=$(cat /var/lib/byod/user/$user)
if [! "$user" -eq "$previousUser"]; then