|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -echo "Warning: This convenience script has been deprecated and will stop functioning in April 2024. Please use the official usage instructions instead. Read the GitHub repository's README for more information." |
| 3 | +echo "Please use the official usage instructions instead. Read the GitHub repository's README for more information." |
4 | 4 |
|
5 | 5 | # Sleeping to ensure the user doesn't just ignore the warning |
6 | 6 | sleep 5 |
7 | 7 |
|
8 | | -echo "Detected operating system: Linux or macOS" |
9 | | -echo "If you are running this script in WSL, please run it in Windows instead." |
10 | | -echo "Sleeping for 5 seconds to allow you to cancel..." |
11 | | -sleep 5 |
12 | | - |
13 | | -echo "Open Android Backup convenience script for Linux and macOS" |
14 | | -echo "This script will install dependencies, download and run the latest release of Open Android Backup." |
15 | | -echo "The script hasn't been fully tested, so feedback is welcome!" |
16 | | -echo "" |
17 | | - |
18 | | -warn_untested_os() { |
19 | | - echo "WARNING: This convenience script has not been tested on your operating system. It may not work as expected." |
20 | | - echo "If you encounter any issues, please report them at https://github.com/mrrfv/open-android-backup/issues" |
21 | | - echo "Continuing in 10 seconds..." |
22 | | - sleep 10 |
23 | | -} |
24 | | - |
25 | | -# Detect OS |
26 | | -if [[ -n "$WSL_DISTRO_NAME" ]]; then |
27 | | - echo "Please run this script from Windows. Running it directly in WSL is unsupported." |
28 | | - exit 1 |
29 | | -else |
30 | | - echo "Not running in WSL, continuing..." |
31 | | -fi |
32 | | - |
33 | | -echo "Installing dependencies - you may be prompted for your password." |
34 | | -if [[ "$OSTYPE" == "darwin"* ]]; then |
35 | | - # macOS |
36 | | - if which brew >/dev/null 2>&1; then |
37 | | - echo "Homebrew is installed, continuing..." |
38 | | - else |
39 | | - echo "Homebrew is not installed. It is needed to continue. Press Enter to automatically install Homebrew." |
40 | | - read -r # wait for enter key |
41 | | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
42 | | - fi |
43 | | - brew install --cask android-platform-tools |
44 | | - brew install p7zip pv bash dialog curl wget unzip |
45 | | -elif [[ -n "$(command -v apt)" ]]; then |
46 | | - # Ubuntu and Debian |
47 | | - sudo apt update && sudo apt install -y p7zip-full adb curl whiptail pv secure-delete wget unzip |
48 | | -elif [[ -n "$(command -v pacman)" ]]; then |
49 | | - # Arch Linux |
50 | | - warn_untested_os |
51 | | - sudo pacman -Syu --noconfirm p7zip curl wget pv bash whiptail adb secure-delete unzip |
52 | | -elif [[ -n "$(command -v dnf)" ]]; then |
53 | | - # Fedora |
54 | | - warn_untested_os |
55 | | - echo "You must first manually add the RPM Sphere and RPM Fusion repositories, see this link for instructions: https://rpmsphere.github.io/" |
56 | | - echo "After adding the repos, press Enter to continue installing dependencies." |
57 | | - read -r # wait for enter key |
58 | | - sudo dnf install p7zip p7zip-plugins adb curl newt pv secure-delete |
59 | | -elif [[ -n "$(command -v zypper)" ]]; then |
60 | | - # openSUSE |
61 | | - warn_untested_os |
62 | | - sudo zypper refresh && sudo zypper install -y p7zip-full curl wget pv bash whiptail android-tools secure-delete unzip |
63 | | -elif [[ -n "$(command -v emerge)" ]]; then |
64 | | - # Gentoo Linux |
65 | | - warn_untested_os |
66 | | - sudo emerge --sync && sudo emerge --ask app-arch/p7zip dev-util/android-tools dev-util/curl net-misc/wget app-arch/unzip app-shells/bash app-misc/dialog app-misc/pv sys-apps/sec |
67 | | -elif [[ -n "$(command -v yum)" ]]; then |
68 | | - # RHEL/CentOS/Oracle Linux/etc. |
69 | | - warn_untested_os |
70 | | - sudo yum update && sudo yum install -y p7zip curl wget pv bash whiptail android-tools secure-delete unzip |
71 | | - |
72 | | -else |
73 | | - echo "Unsupported operating system. Follow the regular installation instructions instead." |
74 | | - echo "If you encounter any issues, please report them at https://github.com/mrrfv/open-android-backup/issues" |
75 | | - exit 1 |
76 | | -fi |
77 | | - |
78 | | -echo "Downloading latest release of Open Android Backup..." |
79 | | -# Download latest release of Open Android Backup and run it. |
80 | | -OAB_DIRECTORY="open_android_backup_conveniencescript_$RANDOM" |
81 | | -LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/mrrfv/open-android-backup/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') |
82 | | - |
83 | | -mkdir -pv $OAB_DIRECTORY && |
84 | | -cd $OAB_DIRECTORY && |
85 | | -wget "https://github.com/mrrfv/open-android-backup/releases/download/$LATEST_RELEASE/Open_Android_Backup_${LATEST_RELEASE}_Bundle.zip" && |
86 | | -unzip "Open_Android_Backup_${LATEST_RELEASE}_Bundle.zip" && |
87 | | -chmod +x backup.sh && |
88 | | -echo "Running Open Android Backup..." && |
89 | | -bash ./backup.sh ; |
90 | | -echo "Cleaning up..." && |
91 | | -cd .. && |
92 | | -rm -rf $OAB_DIRECTORY && |
93 | | -echo "Done!" |
| 8 | +exit 1 |
0 commit comments