From 6517494dda153a84fe7cbe63ad68b2abe80e0e7d Mon Sep 17 00:00:00 2001 From: Griefed Date: Wed, 26 May 2021 18:02:08 +0200 Subject: [PATCH 1/2] fix: Try and fix issue #1 "after each restart, all files are recreated" --- root/etc/cont-init.d/40-config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index 5bb6ad8..4074732 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash -if [ ! -a /config/www/apps.json ]; then +if [ ! -f /config/www/apps.json ]; then cp -f \ /defaults/apps.json \ /config/www/apps.json @@ -10,14 +10,14 @@ if [ ! -a /config/www/apps.json ]; then fi -if [ ! -a /config/www/links.json ]; then +if [ ! -f /config/www/links.json ]; then cp -f \ /defaults/links.json \ /config/www/links.json fi -if [ ! -a /config/www/index.html ]; then +if [ ! -f /config/www/index.html ]; then cp -f \ /defaults/index.html \ /config/www/index.html From 05c3a8d13a474c457798b0d5139b323a0d3e8df8 Mon Sep 17 00:00:00 2001 From: Griefed Date: Wed, 26 May 2021 18:13:32 +0200 Subject: [PATCH 2/2] fix: Add more logging to determine whether scripts work as intended --- root/etc/cont-init.d/30-install | 2 ++ root/etc/cont-init.d/40-config | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/root/etc/cont-init.d/30-install b/root/etc/cont-init.d/30-install index 64de8ea..f871dbc 100644 --- a/root/etc/cont-init.d/30-install +++ b/root/etc/cont-init.d/30-install @@ -19,6 +19,8 @@ if [ ! -f /config/www/sui.lock ]; then /config/www/ rm -Rf /tmp/sui touch /config/www/sui.lock +else + echo "**** lock-file found. Skipping installation... ****" fi # Permission Stuffs diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index 4074732..7255030 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -7,6 +7,8 @@ if [ ! -f /config/www/apps.json ]; then sed -i \ "s/DOMAIN/${DOMAIN}/g" \ /config/www/apps.json +else + echo "**** apps.json-file found. Skipping installation... ****" fi @@ -14,6 +16,8 @@ if [ ! -f /config/www/links.json ]; then cp -f \ /defaults/links.json \ /config/www/links.json +else + echo "**** links.json-file found. Skipping installation... ****" fi @@ -24,6 +28,8 @@ if [ ! -f /config/www/index.html ]; then sed -i \ "s/PROTOCOL/${PROTOCOL}/g" \ /config/www/index.html +else + echo "**** index.html-file found. Skipping installation... ****" fi # Permissions Stuffs