]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adds android-push android-pull
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 23 Oct 2016 15:14:21 +0000 (13:14 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 23 Oct 2016 15:14:21 +0000 (13:14 -0200)
android-pull [new symlink]
android-push [new file with mode: 0755]

diff --git a/android-pull b/android-pull
new file mode 120000 (symlink)
index 0000000..4bac549
--- /dev/null
@@ -0,0 +1 @@
+android-push
\ No newline at end of file
diff --git a/android-push b/android-push
new file mode 100755 (executable)
index 0000000..f3d12cb
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# Push and pull to android device.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+ORIG="$1"
+DEST="$2"
+ANDROID_BASE="${3:-/storage/emulated/0}"
+
+# Check
+if [ -z "$DEST" ]; then
+  echo "Usage: $BASENAME <orig> <dest> [android-base]"
+  echo ""
+  echo "Examples"
+  echo ""
+  echo "android-push /mylocal/music/ Music/"
+  echo "androis-pull Music           /mylocal/music"
+  echo "androis-pull Ringtones       /mylocal/ringtones $ANDROID_BASE"
+  exit 1
+fi
+
+# Run
+if [ "$BASENAME" == "android-pull" ]; then
+  adb pull $ANDROID_BASE/$ORIG $DEST
+else
+  adb push $ORIG $ANDROID_BASE/$DEST
+fi