SHARE
TWEET

Untitled

a guest Aug 14th, 2016 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. clear
  2. serverpath=/home/server
  3. echo "Serverpath: $serverpath"
  4.  
  5. function generate_properties {
  6. echo level-type=$new_level>> $serverpath/$new_id/server.properties
  7. echo max-players=$new_players>> $serverpath/$new_id/server.properties
  8. echo server-port=$new_id>> $serverpath/$new_id/server.properties
  9. echo motd=ServerID$new_id>> $serverpath/$new_id/server.properties
  10. echo spawn-protection=1>> $serverpath/$new_id/server.properties
  11. echo server-name=HostedOnMappleTV>> $serverpath/$new_id/server.properties
  12. echo generator-settings=>> $serverpath/$new_id/server.properties
  13. echo force-gamemode=false>> $serverpath/$new_id/server.properties
  14. echo allow-nether=true>> $serverpath/$new_id/server.properties
  15. echo gamemode=0>> $serverpath/$new_id/server.properties
  16. echo broadcast-console-to-ops=true>> $serverpath/$new_id/server.properties
  17. echo enable-query=false>> $serverpath/$new_id/server.properties
  18. echo player-idle-timeout=0>> $serverpath/$new_id/server.properties
  19. echo difficulty=1>> $serverpath/$new_id/server.properties
  20. echo spawn-monsters=true>> $serverpath/$new_id/server.properties
  21. echo op-permission-level=4>> $serverpath/$new_id/server.properties
  22. echo resource-pack-hash=>> $serverpath/$new_id/server.properties
  23. echo announce-player-achievements=false>> $serverpath/$new_id/server.properties
  24. echo pvp=true>> $serverpath/$new_id/server.properties
  25. echo snooper-enabled=true>> $serverpath/$new_id/server.properties
  26. echo hardcore=false>> $serverpath/$new_id/server.properties
  27. echo enable-command-block=true>> $serverpath/$new_id/server.properties
  28. echo network-compression-threshold=256>> $serverpath/$new_id/server.properties
  29. echo max-world-size=29999984>> $serverpath/$new_id/server.properties
  30. echo debug=false>> $serverpath/$new_id/server.properties
  31. echo server-ip=127.0.0.1>> $serverpath/$new_id/server.properties
  32. echo spawn-npcs=true>> $serverpath/$new_id/server.properties
  33. echo allow-flight=false>> $serverpath/$new_id/server.properties
  34. echo level-name=world>> $serverpath/$new_id/server.properties
  35. echo view-distance=7>> $serverpath/$new_id/server.properties
  36. echo server-id=unnamed>> $serverpath/$new_id/server.properties
  37. echo resource-pack=>> $serverpath/$new_id/server.properties
  38. echo spawn-animals=true>> $serverpath/$new_id/server.properties
  39. echo white-list=false>> $serverpath/$new_id/server.properties
  40. echo generate-structures=true>> $serverpath/$new_id/server.properties
  41. echo max-build-height=256>> $serverpath/$new_id/server.properties
  42. echo online-mode=false>> $serverpath/$new_id/server.properties
  43. echo level-seed=>> $serverpath/$new_id/server.properties
  44. echo use-native-transport=true>> $serverpath/$new_id/server.properties
  45. echo enable-rcon=false>> $serverpath/$new_id/server.properties
  46. }
  47.  
  48. function generate_start.sh {
  49. echo java -Xmx"$new_ram"M -jar craftbukkit.jar -o true>> $serverpath/$new_id/start.sh
  50. }
  51.  
  52. function console_start {
  53. read -p "> " console
  54. echo "$console"
  55.  if [ "$console" == "create" ]
  56.  then
  57.   random_pw=$RANDOM
  58.   read -p "Create a new ID (5 number port): " new_id
  59.   read -p "Max. Players: " new_players
  60.   read -p "Level-Type (FLAT, DEFAULT): " new_level
  61.   read -p "RAM (mb): " new_ram
  62.   date_time=$(date +"%m-%d-%Y-%T")
  63.   echo $date_time ID:$new_id - Players:$new_players - L:$new_level - R:$new_ram>> $serverpath/log.txt
  64.   mkdir /home/server/$new_id
  65.   echo "Generate server.properties..."
  66.   generate_properties
  67.   echo "Generate start.sh..."
  68.   generate_start.sh
  69.   echo "Create new files..."
  70.   cp $serverpath/server/* $serverpath/$new_id/
  71.   echo "Create a new FTP user..."
  72.   adduser mc$new_id --disabled-password --home $serverpath/$new_id/plugins
  73.   echo "mc"$new_id":"$random_pw"" | chpasswd
  74.   usermod -aG mc mc"$new_id"
  75.   echo ----------------------------
  76.   echo Username: mc"$new_id"
  77.   echo Password: "$random_pw"
  78.   echo IP      : 127.0.0.1:"$new_id"
  79.   echo ----------------------------
  80.   echo "SUCCESS"
  81.   console_start
  82.   fi
  83.  if [ "$console" == "delete" ]
  84.  then
  85.  read -p "ID: " del_id
  86.  deluser mc"$del_id"
  87.  rm -r $serverpath/$del_id
  88.  date_time=$(date +"%m-%d-%Y-%T")
  89.  echo $date_time ID:$del_id>> $serverpath/log.txt
  90.  echo "SUCCESS"
  91.  fi
  92. clear
  93. echo "Can't find this command!"
  94. console_start
  95. }
  96.  
  97. console_start
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top