From cf152098465abed02a1dbaa5c6fea7b56451232b Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Tue, 19 Mar 2019 02:06:16 -0400 Subject: [PATCH] work around rsync overwriting destination symlink issue --- webapp/install-mts.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/webapp/install-mts.sh b/webapp/install-mts.sh index 3601ca4..62e4d08 100755 --- a/webapp/install-mts.sh +++ b/webapp/install-mts.sh @@ -55,12 +55,22 @@ if [ ! -d minetest ]; then echo "ERROR: can't install since missing `pwd`/minetest" exit 1 fi -echo "Installing minetest to '$HOME'..." -rsync -rt minetest/ $HOME/minetest -if [ ! -f "$dest_flag_file" ]; then - echo "ERROR: not complete--couldn't create '$dest_flag_file'" - exit 1 +try_dest="/tank/local/owner/minetest" +if [ -d "$try_dest" ]; then + echo "Installing minetest as symlink '$HOME/minetest' pointing to '$try_dest'..." + rsync -rt minetest/ $try_dest + if [ ! -d "$HOME/minetest" ]; then + ln -s $try_dest $HOME/minetest + fi +else + echo "Installing minetest to '$HOME'..." + rsync -rt minetest/ $HOME/minetest + if [ ! -f "$dest_flag_file" ]; then + echo "ERROR: not complete--couldn't create '$dest_flag_file'" + exit 1 + fi fi + flag_dir="$HOME/minetest/games/Bucket_Game" if [ ! -d "$flag_dir" ]; then echo "ERROR: missing $flag_dir"