From b9a511a5e313dd590a8cf7909e666af571b12326 Mon Sep 17 00:00:00 2001 From: Clortox Date: Mon, 8 Mar 2021 16:10:54 -0500 Subject: [PATCH] Add Makefile with install --- Makefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13ff33c --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +############################################################################### +# Tyler Perkins +# 8-3-21 +# Makefile/installer + +INSTALL_PATH = /var/www/html/ + +update_config : var/config.php + cp var/config.php $(INSTALL_PATH)/var/config.php + +install: var/config.php + @echo "Installing to $(INSTALL_PATH)" + @echo "Everything there will be deleted" + @echo "Do you wish to proceed? (Ctrl+C to cancel)" + @echo -n "5 " + @sleep 1 + @echo -n "4 " + @sleep 1 + @echo -n "3 " + @sleep 1 + @echo -n "2 " + @sleep 1 + @echo "1 " + @sleep 1 + @echo "Cleaning out install path..." + rm -rf $(INSTALL_PATH)* + @echo "Moving everything to install directory..." + cp index.php $(INSTALL_PATH) + cp listing.php $(INSTALL_PATH) + cp hiddenlisting.php $(INSTALL_PATH) + cp -r resources $(INSTALL_PATH) + cp -r var $(INSTALL_PATH) + cp -r www $(INSTALL_PATH) + cp -r dir $(INSTALL_PATH) + cp -r helpers $(INSTALL_PATH) + +var/config.php : + if [ ! -f var/config.php ]; then cp var/config.def.php var/config.php; fi;