diff --git a/install-chunkymap-on-ubuntu-from-web.sh b/install-chunkymap-on-ubuntu-from-web.sh index ae48134..6bbb199 100644 --- a/install-chunkymap-on-ubuntu-from-web.sh +++ b/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" \ No newline at end of file +sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh" diff --git a/install-chunkymap-on-ubuntu.sh b/install-chunkymap-on-ubuntu.sh index 13427d9..b5ca469 100644 --- a/install-chunkymap-on-ubuntu.sh +++ b/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 \ No newline at end of file +# NOTE: colors.txt should ALREADY be in $HOME/minetest/util \ No newline at end of file diff --git a/minetestserver-stop.sh b/minetestserver-stop.sh deleted file mode 100644 index 722cbba..0000000 --- a/minetestserver-stop.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -#TODO: set pid then: -# ssh hostname 'kill -TERM $pid' \ No newline at end of file diff --git a/set-minutely-crontab-job.sh b/set-minutely-crontab-job.sh index 0278917..2770356 100644 --- a/set-minutely-crontab-job.sh +++ b/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 \ No newline at end of file +echo "* * * * * root /home/owner/minetest/util/chunkymap-cronjob" >> /etc/crontab diff --git a/stop-mts.sh b/stop-mts.sh new file mode 100644 index 0000000..f6e4a14 --- /dev/null +++ b/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. +# . +# 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' diff --git a/update-chunkymap-installer-only.sh b/update-chunkymap-installer-only.sh index 3730a3a..29ee374 100644 --- a/update-chunkymap-installer-only.sh +++ b/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/" diff --git a/update-chunkymap-on-ubuntu-from-web.sh b/update-chunkymap-on-ubuntu-from-web.sh index effcc29..5c66b66 100644 --- a/update-chunkymap-on-ubuntu-from-web.sh +++ b/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" \ No newline at end of file +sh "$CHUNKYMAP_INSTALLER_DIR/install-chunkymap-on-ubuntu.sh"