Browse Source

working on installer scripts and using HOME env variable

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
2ffae18fb5
  1. 10
      install-chunkymap-on-ubuntu-from-web.sh
  2. 14
      install-chunkymap-on-ubuntu.sh
  3. 3
      minetestserver-stop.sh
  4. 20
      stop-mts.sh
  5. 13
      update-chunkymap-installer-only.sh
  6. 6
      update-chunkymap-on-ubuntu-from-web.sh

10
install-chunkymap-on-ubuntu-from-web.sh

@ -1,7 +1,7 @@
#!/bin/sh
cd ~
rm -Rf ~/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=~/Downloads/minetest-chunkymap
cd $HOME
rm -Rf $HOME/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=$HOME/Downloads/minetest-chunkymap
if [ ! -d "$HOME/Downloads" ]; then
mkdir "$HOME/Downloads"
fi
@ -9,7 +9,7 @@ fi
#chmod +x update-chunkymap-installer-only.sh
#./update-chunkymap-installer-only.sh:
cd ~/Downloads
cd $HOME/Downloads
rm master.zip
wget https://github.com/expertmm/minetest-chunkymap/archive/master.zip
rm -f minetest-chunkymap.zip
@ -25,7 +25,7 @@ chmod +x "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
chmod +x "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-on-ubuntu-from-web.sh"
chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu-from-web.sh"
#mv -f "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" "~/Downloads/"
#mv -f "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" "$HOME/Downloads/"
mv -f "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-on-ubuntu-from-web.sh" "$HOME/Downloads/"
mv -f "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu-from-web.sh" "$HOME/Downloads/"

14
install-chunkymap-on-ubuntu.sh

@ -1,7 +1,7 @@
#!/bin/sh
cd ~
rm -Rf ~/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=~/Downloads/minetest-chunkymap
cd $HOME
rm -Rf $HOME/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=$HOME/Downloads/minetest-chunkymap
if [ ! -d "$HOME/Downloads" ]; then
mkdir "$HOME/Downloads"
fi
@ -9,10 +9,10 @@ fi
MINETEST_UTIL=$HOME/minetest/util
CHUNKYMAP_DEST=$MINETEST_UTIL
#cd ~/Downloads
#rm -f ~/minetestmapper-numpy.py
#cd $HOME/Downloads
#rm -f $HOME/minetestmapper-numpy.py
#wget https://github.com/spillz/minetest/raw/master/util/minetestmapper-numpy.py
#since colors.txt is in ~/minetest/util:
#since colors.txt is in $HOME/minetest/util:
cp -f "$CHUNKYMAP_INSTALLER_DIR/minetestmapper-numpy.py" "$HOME/minetest/util/minetestmapper-numpy.py"
if [ ! -d "$CHUNKYMAP_DEST" ]; then
# Control will enter here if $DIRECTORY doesn't exist.
@ -34,4 +34,4 @@ sudo apt-get install python-numpy python-pil
echo "To check out chunkymap, run:"
echo "cd $CHUNKYMAP_DEST"
# NOTE: colors.txt should ALREADY be in ~/minetest/util
# NOTE: colors.txt should ALREADY be in $HOME/minetest/util

3
minetestserver-stop.sh

@ -1,3 +0,0 @@
#!/bin/sh
#TODO: set pid then:
# ssh hostname 'kill -TERM $pid'

20
stop-mts.sh

@ -0,0 +1,20 @@
#!/bin/sh
MTS_HAYSTACK_PATH=/tmp/mts_haystack
# the space in the sed param means search for a space. The result is all characters before the space.
ps -e | grep minetestserver | sed 's/ .*//' > "$MTS_HAYSTACK_PATH"
#ps -e | grep minetestserver > "$MTS_HAYSTACK_PATH"
# as per TheOther1. linuxquestions.org.
# <http://www.linuxquestions.org/questions/programming-9/bash-shell-script-read-file-line-by-line-136784/>.
# 20 Jan 2004. 19 Feb 2016.
a=0
while read line
do a=$(($a+1));
pid=$line
#echo $pid
#echo $line | sed 's/ .*//'
kill -TERM $pid
done < "$MTS_HAYSTACK_PATH"
echo "Final line count is: $a";
rm "$MTS_HAYSTACK_PATH"
#TODO someday (?):
# ssh hostname 'kill -TERM $pid'

13
update-chunkymap-installer-only.sh

@ -1,12 +1,12 @@
#!/bin/sh
cd ~
rm -Rf ~/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=~/Downloads/minetest-chunkymap
cd $HOME
rm -Rf $HOME/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=$HOME/Downloads/minetest-chunkymap
if [ ! -d "$HOME/Downloads" ]; then
mkdir "$HOME/Downloads"
fi
cd ~/Downloads
cd $HOME/Downloads
rm master.zip
wget https://github.com/expertmm/minetest-chunkymap/archive/master.zip
rm -f minetest-chunkymap.zip
@ -21,6 +21,5 @@ chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
chmod +x "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
chmod +x "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-on-ubuntu-from-web.sh"
#mv -f "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" "~/Downloads/"
mv -f "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-on-ubuntu-from-web.sh" "~/"
#mv -f "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" "$HOME/Downloads/"
mv -f "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-on-ubuntu-from-web.sh" "$HOME/"

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

@ -1,5 +1,5 @@
#!/bin/sh
cd ~
cd $HOME
#rm -Rf $HOME/minetest-stuff/minetest-chunkymap
CHUNKYMAP_INSTALLER_DIR=$HOME/Downloads/minetest-chunkymap
if [ ! -d "$HOME/Downloads" ]; then
@ -8,8 +8,8 @@ fi
#cd $CHUNKYMAP_INSTALLER_DIR
chmod +x update-chunkymap-installer-only.sh
cd ~/Downloads
mv -f "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
cd $HOME/Downloads
mv -f update-chunkymap-installer-only.sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
sh "$CHUNKYMAP_INSTALLER_DIR/update-chunkymap-installer-only.sh"
#./install-chunkymap-on-ubuntu.sh
chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"

Loading…
Cancel
Save