Browse Source

working on installer scripts and using HOME env variable

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

12
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,10 +25,10 @@ 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/"
chmod +x "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"

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'

2
set-minutely-crontab-job.sh

@ -3,4 +3,4 @@ sudo su -
# NOTE: this works only since user is a field on Ubuntu (on some GNU/Linux systems it is not, which is implied by omission at http://www.adminschoice.com/crontab-quick-reference)
# Minute, Hour, Day of Month, Month (1 to 12), Day of Week
# m h dom mon dow user command
echo "* * * * * root /home/owner/minetest/util/chunkymap-cronjob" >> /etc/crontab
echo "* * * * * root /home/owner/minetest/util/chunkymap-cronjob" >> /etc/crontab

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/"

8
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,9 +8,9 @@ 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"
sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"
sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"

Loading…
Cancel
Save