Advertisement
Guest User

Cheats installer (Linux).sh

a guest
Sep 22nd, 2024
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.62 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Download directory (temporary)
  4. temp_dir=$(mktemp -d)
  5.  
  6. # Download and unzip the cheat files
  7. wget https://github.com/iSharingan/CTRPF-AR-CHEAT-CODES/archive/refs/heads/master.zip -O "$temp_dir/cheats.zip" || {
  8.   echo "Error downloading cheat files. Please check your internet connection."
  9.   exit 1
  10. }
  11. unzip "$temp_dir/cheats.zip" -d "$temp_dir" || {
  12.   echo "Error unzipping cheat files. Please check the archive integrity."
  13.   exit 1
  14. }
  15.  
  16. # Select emulator
  17. echo "Select your emulator:"
  18. echo "1. Old Citra"
  19. echo "2. Lime3DS (AppImage)"
  20. echo "3. Lime3DS (Flathub)"
  21. echo "4. Pablo MK7's Citra (AppImage)"
  22. read emulador
  23.  
  24. # Define destination folder based on emulator (improve error handling)
  25. case $emulador in
  26.   1)
  27.     dest_dir="/home/$USER/.local/share/citra-emu"
  28.     ;;
  29.   2)
  30.     dest_dir="/home/$USER/.local/share/lime3ds-emu"
  31.     ;;
  32.   3)
  33.     dest_dir="/home/$USER/.var/app/io.github.lime3ds.Lime3DS/data/lime3ds-emu"
  34.     ;;
  35.   4)
  36.     dest_dir="/home/$USER/.local/share/citra-emu"
  37.     ;;
  38.   *)
  39.     echo "Invalid emulator selection."
  40.     exit 1
  41.     ;;
  42. esac
  43.  
  44. # Create "cheats" subfolder if it doesn't exist
  45. cheats_dir="$dest_dir/cheats"
  46. if [ ! -d "$cheats_dir" ]; then
  47.   mkdir -p "$cheats_dir"
  48.   echo "The '$cheats_dir' folder has been created."
  49. fi
  50.  
  51. # Get and copy cheat files
  52. source_dir="$temp_dir/CTRPF-AR-CHEAT-CODES-master/Cheats"  # Assuming all cheats are in the "Cheats" folder
  53. find "$source_dir" -type f -exec cp {} "$cheats_dir" \;
  54.  
  55. # User messages
  56. echo "Starting the copy of the files..."
  57. echo "Copy completed. You can close the script."
  58.  
  59. # Clean up temporary directory
  60. rm -rf "$temp_dir"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement