Am I doing this right??
I am terrible at writing shell scripts but I was trying to follow along by some examples listed online and was wondering if I could get some guidance as to if I did this correctly before I run it… Also what would this hurt if I ran this script while the servers were running?
Below is my shell script that I put together to update my many AMP minecraft instances…
#!/bin/sh ##Filename=script.sh ##Notes Don't forget to chmod +rwx ./script.sh ## Created by LorenTedford.com rm -rf /home/amp/Minecraft/BuildData rm -rf /home/amp/Minecraft/BuildTools.log.txt rm -rf /home/amp/Minecraft/Bukkit rm -rf /home/amp/Minecraft/CraftBukkit rm -rf /home/amp/Minecraft/apache-maven-3.6.0 rm -rf /home/amp/Minecraft/Spigot rm -rf /home/amp/Minecraft/work rm -rf /home/amp/Minecraft/spigot-1.19.2.jar rm -rf /home/amp/Minecraft/BuildTools.jar wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar ## Change the --rev to Version you desire java -jar BuildTools.jar --rev 1.19.2 ##cp -rf /home/amp/Minecraft/spigot-1.19.2.jar /home/amp/.ampdata/instances/creative/Minecraft/spigot-1.19.2.jar ##cp -rf /home/amp/Minecraft/spigot-1.19.2.jar /home/amp/.ampdata/instances/Lobby/Minecraft/spigot-1.19.2.jar ##cp -rf /home/amp/Minecraft/spigot-1.19.2.jar /home/amp/.ampdata/instances/Ltcraft/Minecraft/spigot-1.19.2.jar ##cp -rf /home/amp/Minecraft/spigot-1.19.2.jar /home/amp/.ampdata/instances/mark/Minecraft/spigot-1.19.2.jar ##cp -rf /home/amp/Minecraft/spigot-1.19.2.jar /home/amp/.ampdata/instances/survival/Minecraft/spigot-1.19.2.jar echo Spigot Update Script Completed! exit
Am I doing this correctly? Everything above the copy commands seem to work just fine I think… My concern is what damage would occur If I ran this let’s say one day a week for all the servers at once? Like in a crontab or some thing.
Also how do I cd the wget command into a folder I can’t seem to get it to stay in the folder unless I run the script from that folder.
Thanks in advance for your assistance!