proper check for non-empty index.html

This commit is contained in:
AJ ONeal 2017-04-21 01:02:55 -06:00
parent 41f2d3e480
commit 30b05467d7
1 changed files with 1 additions and 1 deletions

View File

@ -320,7 +320,7 @@ CADDY_EOF
$sudo_cmd chmod 755 $PREFIX/srv/www
$sudo_cmd chmod 755 $PREFIX/srv/www/localhost
if [ ! -f "$PREFIX/srv/www/localhost/index.html" ] || [ -z "$(cat $PREFIX/srv/www/localhost)" ]; then
if [ ! -f "$PREFIX/srv/www/localhost/index.html" ] || [ -z "$(cat $PREFIX/srv/www/localhost/index.html)" ]; then
$http_get $http_opts "$caddy_localhost_index" $http_out $PREFIX/tmp/$caddy_dir/index.html
$sudo_cmd mv $PREFIX/tmp/$caddy_dir/index.html $PREFIX/srv/www/localhost/
$sudo_cmd chown -R $caddy_user:$caddy_group $PREFIX/srv/www/localhost/