vhost-stack/bin/vhost-varnish-update-sites.sh
Matthew Saunders Brown de4e34d6ba permissions
2021-08-15 12:58:17 -07:00

28 lines
487 B
Bash
Executable File

#!/bin/bash
#
# vhost-stack
# https://git.stack-source.com/msb/vhost-stack
# MIT License Copyright (c) 2021 Matthew Saunders Brown
# load include file
source $(dirname $0)/vhost.sh
if [ ! -f /etc/varnish/sites.d/example.com.vcl ]; then
echo "ERROR: example.vlc does not exist"
exit 1
fi
sitesArray=(`ls -1 /etc/varnish/sites.d/`)
truncate -s 0 /etc/varnish/sites.vcl
for site in "${sitesArray[@]}"
do
echo include \"sites.d/$site\"\; >> /etc/varnish/sites.vcl
done
exit 0