From: nishi Date: Sat, 11 May 2024 13:02:57 +0000 (+0000) Subject: make the installer ask to overwrite the config or not X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1fdf8edd6a8773b3f7cb78c0d138f3327548dc74;p=mandshurica.git make the installer ask to overwrite the config or not git-svn-id: file:///raid/svn-main/nishi-mandshurica/trunk@92 f982e544-4a7d-3444-ad1a-fde59a2a69f1 --- diff --git a/GNUmakefile b/GNUmakefile index b7e5f24..ac8caac 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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)