Browse Source

made variable names match install script

and made bones logic more paranoid
master
poikilos 7 years ago
committed by Jacob Gustafson
parent
commit
6f0185fc96
  1. 32
      etc/minetestserver-update-from-git.sh

32
etc/minetestserver-update-from-git.sh

@ -30,27 +30,27 @@ if [ -d "$HOME/Downloads/minetest" ]; then
#git fetch #git fetch
#git checkout HEAD games/minetest_game #git checkout HEAD games/minetest_game
sudo make install sudo make install
USR_SHARE_MINETEST="/usr/local/share/minetest"
MT_GAMES_DIR="/usr/local/share/minetest/games" MT_GAMES_DIR="$USR_SHARE_MINETEST/games"
if [ -d "$MT_GAMES_DIR/minetest_game" ]; then if [ -d "$MT_GAMES_DIR/minetest_game" ]; then
if [ ! -d "$MT_GAMES_DIR/minetest_game" ]; then if [ ! -d "$MT_GAMES_DIR/minetest_game" ]; then
sudo mkdir -p "$MT_GAMES_DIR/minetest_game" sudo mkdir -p "$MT_GAMES_DIR/minetest_game"
fi fi
MY_SUBGAME_PATH="$MT_GAMES_DIR/ENLIVEN" MT_MYGAME_DIR="$MT_GAMES_DIR/ENLIVEN"
if [ -d "$MY_SUBGAME_PATH" ]; then if [ -d "$MT_MYGAME_DIR" ]; then
echo "updating " echo "updating "
sudo rsync -rtv "$HOME/Downloads/minetest/games/minetest_game/mods/" "$MY_SUBGAME_PATH/mods/" sudo rsync -rtv "$HOME/Downloads/minetest/games/minetest_game/mods/" "$MT_MYGAME_DIR/mods/"
if [ -d "$MY_SUBGAME_PATH/mods/tsm_chests_dungeon" ]; then if [ -d "$MT_MYGAME_DIR/mods/tsm_chests_dungeon" ]; then
echo "REMOVING dungeon_loot since tsm_chests_dungeon is installed (even though more than one should work now since https://github.com/minetest/minetest/issues/6590 is resolved, dungeon_loot would be redundant in this case)..." echo "REMOVING dungeon_loot since tsm_chests_dungeon is installed (even though more than one should work now since https://github.com/minetest/minetest/issues/6590 is resolved, dungeon_loot would be redundant in this case)..."
sudo rm -Rf "$MY_SUBGAME_PATH/mods/dungeon_loot" sudo rm -Rf "$MT_MYGAME_DIR/mods/dungeon_loot"
fi fi
else else
echo "skipping update of components from minetest_game since does not exist: " echo "skipping update of components from minetest_game since does not exist: "
echo " $MY_SUBGAME_PATH" echo " $MT_MYGAME_DIR"
fi fi
echo "patching bones (this will not be needed after https://github.com/minetest/minetest_game/pull/2082 is merged)..." echo "patching bones (this will not be needed after https://github.com/minetest/minetest_game/pull/2082 is merged)..."
if [ -d "$MY_SUBGAME_PATH/mods/bones" ]; then if [ -f "$MT_MYGAME_DIR/mods/bones/init.lua" ]; then
cd "$MY_SUBGAME_PATH/mods/bones" cd "$MT_MYGAME_DIR/mods/bones"
if [ -f init.bak ]; then if [ -f init.bak ]; then
sudo rm init.bak sudo rm init.bak
fi fi
@ -67,13 +67,13 @@ if [ -d "$HOME/Downloads/minetest" ]; then
git pull git pull
cd .. cd ..
fi fi
sudo rm -Rf "$MY_SUBGAME_PATH/mods/farming" sudo rm -Rf "$MT_MYGAME_DIR/mods/farming"
sudo cp -Rf farming "$MY_SUBGAME_PATH/mods/" sudo cp -Rf farming "$MT_MYGAME_DIR/mods/"
sudo rm -Rf "$MY_SUBGAME_PATH/mods/farming/.git" sudo rm -Rf "$MT_MYGAME_DIR/mods/farming/.git"
sudo rm "$MY_SUBGAME_PATH/mods/farming/screenshot.png" sudo rm "$MT_MYGAME_DIR/mods/farming/screenshot.png"
sudo rm "$MY_SUBGAME_PATH/mods/farming/.gitignore" sudo rm "$MT_MYGAME_DIR/mods/farming/.gitignore"
else else
echo "ERROR: missing '$MY_SUBGAME_PATH/mods/bones'" echo "ERROR: missing '$MT_MYGAME_DIR/mods/bones/init.lua'"
fi fi
else else
echo "WARNING: could not find $MT_GAMES_DIR/minetest_game" echo "WARNING: could not find $MT_GAMES_DIR/minetest_game"

Loading…
Cancel
Save