]> Nishi Git Mirror - mandshurica.git/commitdiff
make the installer ask to overwrite the config or not
authornishi <nishi@f982e544-4a7d-3444-ad1a-fde59a2a69f1>
Sat, 11 May 2024 13:02:57 +0000 (13:02 +0000)
committernishi <nishi@f982e544-4a7d-3444-ad1a-fde59a2a69f1>
Sat, 11 May 2024 13:02:57 +0000 (13:02 +0000)
git-svn-id: file:///raid/svn-main/nishi-mandshurica/trunk@92 f982e544-4a7d-3444-ad1a-fde59a2a69f1

GNUmakefile

index b7e5f2485ed8c25e99cccb2449373e4beb9f11f6..ac8caacce027c30e972f7a6ebc4445470594f7eb 100644 (file)
@@ -54,7 +54,21 @@ replace:
 install: all
        mkdir -p $(PREFIX) $(MODULE_PREFIX) $(DATABASE_PREFIX) $(WEBROOT_PREFIX) $(PROJECT_PREFIX) $(TOOL_PREFIX) $(PREFIX)/etc $(PREFIX)/bin $(PREFIX)/lib/mandshurica/db
        touch $(PREFIX)/lib/mandshurica/db/auth.db $(PREFIX)/lib/mandshurica/db/login.db $(PREFIX)/lib/mandshurica/db/project.db
-       ./Mandshurica/mandshurica --create $(PREFIX)/etc/mandshurica.conf
+       if [ -e $(PREFIX)/etc/mandshurica.conf ]; then \
+               while true; do\
+                       read -p "Overwrite the config with default one? " "yn";\
+                       if [ "$$yn" = "y" -o "$$yn" = "Y" ]; then\
+                               ./Mandshurica/mandshurica --create $(PREFIX)/etc/mandshurica.conf;\
+                               break;\
+                       elif [ "$$yn" = "n" -o "$$yn" = "N" ]; then\
+                               break;\
+                       else\
+                               echo "Please enter Y or N";\
+                       fi;\
+               done;\
+       else\
+               ./Mandshurica/mandshurica --create $(PREFIX)/etc/mandshurica.conf;\
+       fi
        $(MAKE) -C ./Mandshurica install $(PREFIXES)
        $(MAKE) -C ./Module install $(PREFIXES)
        $(MAKE) -C ./Tool install $(PREFIXES)