From 42e2df1ef4fbd2da94db9a9217bd94864368e88b Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Wed, 24 Feb 2016 11:35:53 -0500 Subject: [PATCH] make updater update php and images if using default website directory or you change updater to use your website directory --- README.md | 11 ++++++++++- update-chunkymap-on-ubuntu-from-web.sh | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 691eb1a..ca03d4d 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,19 @@ This program comes without any warranty, to the extent permitted by applicable l `minetestserver` then when it is finished loading, press Ctrl C then run: `chmod +x install-chunkymap-on-ubuntu.sh && ./install-chunkymap-on-ubuntu.sh` -* IF you are using a distro such as Ubuntu 14.04 where first line of /etc/crontab is "m h dom mon dow user command" then if you want regular refresh of map then run + * IF you are using a distro such as Ubuntu 14.04 where first line of /etc/crontab is "m h dom mon dow user command" then if you want regular refresh of map then run (otherwise first edit the script to fit your crontab then) (if you are not using /var/www/html/minetest/chunkymapdata, edit chunkymap-cronjob script to use the correct folder, then) `chmod +x set-minutely-crontab-job.sh && ./set-minutely-crontab-job.sh` +* IF you are using Linux + * Either copy your code to index-example.php and use it, or just rename it to map.php (or anything you want) then link to it. + # The commands below will work if you are using the web installer, or have done mv minetest-chunkymap-master "$HOME/Downloads/minetest-chunkymap" (and if you are using /var/www/html/minetest -- otherwise change that) + MT_MY_WEBSITE_PATH=/var/www/html/minetest + sudo cp -f "$HOME/Downloads/minetest-chunkymap/web/chunkymap.php" "$MT_MY_WEBSITE_PATH/chunkymap.php" + sudo cp --no-clobber "$HOME/Downloads/minetest-chunkymap/web/index_example.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php" + sudo cp -R --no-clobber "$HOME/Downloads/minetest-chunkymap/web/images/*" "$MT_MY_WEBSITE_PATH/images/" + #--no-clobber: do not overwrite existing + # after you do this, the update script will do it for you if you are using /var/www/html/minetest, otherwise edit the update script before using it to get these things updated * IF you are using Windows * put these files anywhere * manually schedule a task in Task Scheduler to run C:\Python27\python chunkymap-regen.py every minute diff --git a/update-chunkymap-on-ubuntu-from-web.sh b/update-chunkymap-on-ubuntu-from-web.sh index 5c66b66..9a52d09 100644 --- a/update-chunkymap-on-ubuntu-from-web.sh +++ b/update-chunkymap-on-ubuntu-from-web.sh @@ -14,3 +14,14 @@ sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh" #./install-chunkymap-on-ubuntu.sh chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" + +MT_MY_WEBSITE_PATH=/var/www/html/minetest + +if [ -f "$HOME/Downloads/minetest-chunkymap/web/chunkymap.php" ]; then + if [ -f "$MT_MY_WEBSITE_PATH/chunkymap.php" ]; then + sudo cp -f "$HOME/Downloads/minetest-chunkymap/web/chunkymap.php" "$MT_MY_WEBSITE_PATH/chunkymap.php" + sudo cp --no-clobber "$HOME/Downloads/minetest-chunkymap/web/index_example.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php" + sudo cp -R --no-clobber "$HOME/Downloads/minetest-chunkymap/web/images/*" "$MT_MY_WEBSITE_PATH/images/" + #--no-clobber: do not overwrite existing + fi +fi \ No newline at end of file