Advertisement
Guest User

mfbot autoinstaller

a guest
Dec 20th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. #!/bin/bash -x
  2.  
  3. # Ngrok authentication token (replace 'YOUR_NGROK_AUTH_TOKEN' with your actual token)
  4. NGROK_AUTH_TOKEN="YOUR_NGROK_AUTH_TOKEN"
  5.  
  6. # Set timezone to Europe/Berlin
  7. sudo timedatectl set-timezone Europe/Berlin
  8.  
  9. # 1. System update and upgrade
  10. sudo apt-get update
  11. sudo apt-get upgrade -y
  12.  
  13. # Install Mono
  14. sudo apt-get install mono-complete -y
  15.  
  16. # Install required packages
  17. sudo apt-get install -y build-essential libcurl4-openssl-dev libssl-dev libcurl4-gnutls-dev libmariadb-dev-compat librtmp-dev libmariadb-dev libmariadb-dev-compat tk-dev libncurses5-dev libncursesw5-dev libreadline-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libssl-dev libffi-dev python3-dev python3-pip
  18.  
  19. # Install tmux
  20. sudo apt-get install -y tmux
  21.  
  22. # Install jq
  23. sudo apt-get install -y jq
  24.  
  25. # Install lm-sensors
  26. sudo apt-get install -y lm-sensors
  27. sudo sensors-detect --auto
  28.  
  29. # Download, compile, and install Python 3.6.5
  30. wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
  31. tar xf Python-3.6.5.tar.xz
  32. cd Python-3.6.5
  33. ./configure
  34. make -j4
  35. sudo make altinstall
  36. sudo pip3.6 install --upgrade pip
  37.  
  38. # Clean up downloaded files
  39. cd ..
  40. sudo rm -r Python-3.6.5
  41. rm Python-3.6.5.tar.xz
  42.  
  43. # Install necessary dependencies for dash and pycurl
  44. sudo apt-get install -y libssl-dev libffi-dev python3-dev python3-pip
  45.  
  46. # Install wheel package
  47. sudo pip3.6 install wheel
  48.  
  49. # Install dash and pycurl
  50. pip3.6 install dash pycurl
  51.  
  52. # Download and install MFbot from the specified URL
  53. wget https://download.mfbot.de/latest/MFBot_Konsole_ARM64
  54. chmod +x MFBot_Konsole_ARM64
  55.  
  56. # Create the mfbot-webinterface directory if it doesn't exist
  57. mkdir -p mfbot-webinterface
  58.  
  59. # Enter the web interface directory
  60. cd mfbot-webinterface || { echo "Error: Unable to change to mfbot-webinterface directory."; exit 1; }
  61.  
  62. # Add Ngrok authentication token
  63. wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz
  64. tar -xzf ngrok-stable-linux-arm64.tgz
  65. rm ngrok-stable-linux-arm64.tgz
  66. ./ngrok authtoken "$NGROK_AUTH_TOKEN"
  67.  
  68. # Check if mf_Curator.sh is already in place
  69. if [ -f mf_Curator.sh ]; then
  70. echo "mf_Curator.sh is already in place."
  71. else
  72. # Wait for mf_Curator.sh to be placed
  73. while [ ! -f mf_Curator.sh ]; do
  74. echo "Please place mf_Curator.sh inside the mfbot-webinterface directory. Press Enter when done."
  75. read -r
  76. done
  77. fi
  78.  
  79. # Make mf_Curator.sh executable
  80. chmod +x mf_Curator.sh
  81.  
  82. # Download and extract the MF Bot web interface to its folder
  83. wget https://download.mfbot.de/v5.0.0.4/mfbot-webinterface.zip
  84. unzip mfbot-webinterface.zip
  85. rm mfbot-webinterface.zip
  86.  
  87. # Remove existing requirements.txt
  88. rm requirements.txt
  89.  
  90. # Create a new requirements.txt file
  91. echo -e "pandas>=0.23.0\nplotly>=2.7.0\ndash==0.21.1\ndash-core-components==0.23.0\ndash-html-components==0.11.0\ndash-table-experiments==0.6.0\ndash-renderer==0.13.0\npycurl==7.43.0.2\nnumpy>=1.14.4\ndash-auth==1.0.2\nflask==1.0.2\ncolorama==0.3.9\nwheel" > requirements.txt
  92.  
  93. # Check if pip3.6 is available
  94. if command -v pip3.6 >/dev/null 2>&1; then
  95. pip3.6 install -r requirements.txt
  96. else
  97. # Install zlib1g-dev
  98. sudo apt-get update
  99. sudo apt-get install -y zlib1g-dev
  100.  
  101. # Install pip manually for Python 3.6
  102. wget https://bootstrap.pypa.io/pip/3.6/get-pip.py
  103. sudo python3.6 get-pip.py
  104. rm get-pip.py
  105.  
  106. # Install dependencies using pip3.6 for Python 3.6
  107. pip3.6 install -r requirements.txt
  108. fi
  109.  
  110. # Download Ngrok from the specified URL and extract it in the web interface directory
  111. wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm64.tgz
  112. tar -xzf ngrok-v3-stable-linux-arm64.tgz
  113. rm ngrok-v3-stable-linux-arm64.tgz
  114.  
  115. # Make mf_Curator.sh executable or exit if not found
  116. if [ -f mf_Curator.sh ]; then
  117. chmod +x mf_Curator.sh
  118. else
  119. echo "Error: mf_Curator.sh not found. Please make sure it exists."
  120. exit 1
  121. fi
  122.  
  123. # Start the mf_Curator.sh script
  124. ./mf_Curator.sh
  125.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement