diff --git a/rootfs/root/docker/setup/03-files.sh b/rootfs/root/docker/setup/03-files.sh index 94dd5cb..3ee690f 100755 --- a/rootfs/root/docker/setup/03-files.sh +++ b/rootfs/root/docker/setup/03-files.sh @@ -37,18 +37,22 @@ if [ -d "/tmp/bin" ]; then done fi unset bin -if [ -d "/tmp/data" ]; then - for data in "/tmp/data"/*; do - name="$(basename "$data")" - echo "Installing $name to /usr/local/share/template-files/data/$name" - mkdir -p "/usr/local/share/template-files/data/$name" - copy "$data"/* "/usr/local/share/template-files/data/$name" +if [ -d "/tmp/var" ]; then + for var in "/tmp/var"/*; do + name="${var//\/tmp\/var\//}" + echo "Installing $var to /var/$name" + if [ -d "$var" ]; then + mkdir -p "/var/$name" + copy "$var"/* "/var/$name/" + else + copy "$var" "/var/$name" + fi done fi -unset data +unset var if [ -d "/tmp/etc" ]; then for config in "/tmp/etc"/*; do - name="${config//\/tmp\/etc/\/}" + name="${config//\/tmp\/etc\//}" echo "Installing $config to /etc/$name" if [ -d "$config" ]; then mkdir -p "/etc/$name" @@ -62,6 +66,19 @@ if [ -d "/tmp/etc" ]; then done fi unset config +if [ -d "/tmp/data" ]; then + for data in "/tmp/data"/*; do + name="${data//\/tmp\/data\//}" + echo "Installing $data to /usr/local/share/template-files/data" + if [ -d "$data" ]; then + mkdir -p "/usr/local/share/template-files/data/$name" + copy "$data"/* "/usr/local/share/template-files/data/$name/" + else + copy "$data" "/usr/local/share/template-files/data/$name" + fi + done +fi +unset data # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Main script diff --git a/rootfs/usr/local/share/template-files/config/bind/named.conf b/rootfs/tmp/etc/bind/named.conf similarity index 100% rename from rootfs/usr/local/share/template-files/config/bind/named.conf rename to rootfs/tmp/etc/bind/named.conf diff --git a/rootfs/usr/local/share/template-files/config/bind/rndc.key b/rootfs/tmp/etc/bind/rndc.key similarity index 100% rename from rootfs/usr/local/share/template-files/config/bind/rndc.key rename to rootfs/tmp/etc/bind/rndc.key diff --git a/rootfs/usr/local/share/template-files/config/nginx/fastcgi_params b/rootfs/tmp/etc/nginx/fastcgi_params similarity index 100% rename from rootfs/usr/local/share/template-files/config/nginx/fastcgi_params rename to rootfs/tmp/etc/nginx/fastcgi_params diff --git a/rootfs/usr/local/share/template-files/config/nginx/mime.types b/rootfs/tmp/etc/nginx/mime.types similarity index 100% rename from rootfs/usr/local/share/template-files/config/nginx/mime.types rename to rootfs/tmp/etc/nginx/mime.types diff --git a/rootfs/usr/local/share/template-files/config/nginx/nginx.conf b/rootfs/tmp/etc/nginx/nginx.conf similarity index 100% rename from rootfs/usr/local/share/template-files/config/nginx/nginx.conf rename to rootfs/tmp/etc/nginx/nginx.conf diff --git a/rootfs/usr/local/share/template-files/config/php/php-fpm.conf b/rootfs/tmp/etc/php/php-fpm.conf similarity index 100% rename from rootfs/usr/local/share/template-files/config/php/php-fpm.conf rename to rootfs/tmp/etc/php/php-fpm.conf diff --git a/rootfs/usr/local/share/template-files/config/php/php-fpm.d/www.conf b/rootfs/tmp/etc/php/php-fpm.d/www.conf similarity index 100% rename from rootfs/usr/local/share/template-files/config/php/php-fpm.d/www.conf rename to rootfs/tmp/etc/php/php-fpm.d/www.conf diff --git a/rootfs/usr/local/share/template-files/config/php/php.ini b/rootfs/tmp/etc/php/php.ini similarity index 100% rename from rootfs/usr/local/share/template-files/config/php/php.ini rename to rootfs/tmp/etc/php/php.ini diff --git a/rootfs/usr/local/share/template-files/data/bind/root.cache b/rootfs/tmp/var/bind/bind/root.cache similarity index 100% rename from rootfs/usr/local/share/template-files/data/bind/root.cache rename to rootfs/tmp/var/bind/bind/root.cache