summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md7
-rwxr-xr-xandrodeb14
2 files changed, 19 insertions, 2 deletions
diff --git a/README.md b/README.md
index 9f326e2..d4e5655 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,13 @@ cd adeb
# Add some short cuts:
sudo ln -s $(pwd)/adeb /usr/bin/adeb
+
+# For cached image downloads which result in a huge speed-up,
+# You could set the ADEB_REPO_URL environment variable in your
+# bashrc file.
+# Disclaimer: Google is not liable for the below URL and this
+# is just an example.
+export ADEB_REPO_URL="github.com/joelagnel/"
```
* Installing adeb onto your device:
diff --git a/androdeb b/androdeb
index 9c7d4a5..9d343aa 100755
--- a/androdeb
+++ b/androdeb
@@ -225,8 +225,18 @@ if [ $DOWNLOAD -eq 1 ]; then
c_info "Downloading Androdeb from the web..."; c_info ""
# Github dropped tar gz support! ##?#??#! Now we've to zip everything.
- curl -L https://github.com/joelagnel/adeb/releases/download/$VERSION/$FNAME --output $TDIR_ABS/$FNAME
- unzip -e $TDIR_ABS/$FNAME -d $TDIR_ABS/
+ if [ -z $ADEB_REPO_URL ]; then
+ c_warning "Automatic download is disabled. To enable it, please set the \$ADEB_REPO_URL"
+ c_warning "environment variable as recommended in the setup instructions in the README.md"
+ do_cleanup
+ exit 0
+ fi
+
+ curl -L https://$ADEB_REPO_URL/adeb/releases/download/$VERSION/$FNAME --output $TDIR_ABS/$FNAME ||
+ die 9 "Failed to download adeb release."
+
+ unzip -e $TDIR_ABS/$FNAME -d $TDIR_ABS/ ||
+ die 10 "Failed to download adeb release. Double check the ADEB_REPO_URL value."
TARF=$TDIR_ABS/$FNAME_UZ
fi