Browse Source

run update after updater is updated

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
d83f75f87c
  1. 28
      post-update.sh
  2. 27
      update-chunkymap-on-ubuntu-from-web.sh

28
post-update.sh

@ -0,0 +1,28 @@
#./install-chunkymap-on-ubuntu.sh
CHUNKYMAP_INSTALLER_DIR=$HOME/Downloads/minetest-chunkymap
CHUNKYMAP_DEST=$HOME/chunkymap
if [ ! -d "$HOME/Downloads" ]; then
mkdir "$HOME/Downloads"
fi
cd $HOME/Downloads
chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
echo ""
echo "running install-chunkymap-on-ubuntu.sh..."
sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
echo "...returned to update-chunkymap-on-ubuntu-from-web.sh"
echo ""
MT_MY_WEBSITE_PATH=/var/www/html/minetest
# IF already installed to default MT_MY_WEBSITE_PATH, update the files:
if [ -f "$HOME/chunkymap/web/chunkymap.php" ]; then
if [ -f "$MT_MY_WEBSITE_PATH/chunkymap.php" ]; then
sudo cp -f "$HOME/chunkymap/web/chunkymap.php" "$MT_MY_WEBSITE_PATH/"
echo "updated $MT_MY_WEBSITE_PATH/chunkymap.php"
#sudo cp --no-clobber "$HOME/Downloads/minetest-chunkymap/web/viewchunkymap.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php"
sudo cp -f "$HOME/chunkymap/web/viewchunkymap.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php"
echo "updated $MT_MY_WEBSITE_PATH/viewchunkymap.php"
# cannot put wildcard in quotes on unix
#sudo cp -R --no-clobber $HOME/Downloads/minetest-chunkymap/web/images/* "$MT_MY_WEBSITE_PATH/images/"
#--no-clobber: do not overwrite existing
fi
fi

27
update-chunkymap-on-ubuntu-from-web.sh

@ -19,29 +19,10 @@ fi
#sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh" #sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
if [ -f "$CHUNKYMAP_DEST/update-chunkymap-installer-only.sh" ]; then if [ -f "$CHUNKYMAP_DEST/update-chunkymap-installer-only.sh" ]; then
sh "$CHUNKYMAP_DEST/update-chunkymap-installer-only.sh" sh "$CHUNKYMAP_DEST/update-chunkymap-installer-only.sh"
#further instructions are in separate file in case updater was updated:
sh "$CHUNKYMAP_DEST/post-update.sh"
else else
sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh" sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
fi #further instructions are in separate file in case updater was updated:
#./install-chunkymap-on-ubuntu.sh sh "$CHUNKYMAP_INSTALLER_DIR/post-update.sh"
cd $HOME/Downloads
chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
echo ""
echo "running install-chunkymap-on-ubuntu.sh..."
sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
echo "...returned to update-chunkymap-on-ubuntu-from-web.sh"
echo ""
MT_MY_WEBSITE_PATH=/var/www/html/minetest
# IF already installed to default MT_MY_WEBSITE_PATH, update the files:
if [ -f "$HOME/chunkymap/web/chunkymap.php" ]; then
if [ -f "$MT_MY_WEBSITE_PATH/chunkymap.php" ]; then
sudo cp -f "$HOME/chunkymap/web/chunkymap.php" "$MT_MY_WEBSITE_PATH/"
echo "updated $MT_MY_WEBSITE_PATH/chunkymap.php"
#sudo cp --no-clobber "$HOME/Downloads/minetest-chunkymap/web/viewchunkymap.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php"
sudo cp -f "$HOME/chunkymap/web/viewchunkymap.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php"
echo "updated $MT_MY_WEBSITE_PATH/viewchunkymap.php"
# cannot put wildcard in quotes on unix
#sudo cp -R --no-clobber $HOME/Downloads/minetest-chunkymap/web/images/* "$MT_MY_WEBSITE_PATH/images/"
#--no-clobber: do not overwrite existing
fi
fi fi

Loading…
Cancel
Save