-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathphone
More file actions
executable file
·47 lines (39 loc) · 943 Bytes
/
Copy pathphone
File metadata and controls
executable file
·47 lines (39 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/sh
# @author nate zhou
# @since 2025,2026
# android phone script
# @depends android-file-transfer
# This script has completions: `.config/{z,ba}sh/completions/_scripts.{z,ba}sh`
MOUNTING_POINT=${HOME}/mnt
[ -d "$MOUNTING_POINT" ] || mkdir "$MOUNTING_POINT"
list() {
ls "$MOUNTING_POINT"
}
mount() {
aft-mtp-mount "$MOUNTING_POINT"
}
unmount() {
fusermount3 -u "$MOUNTING_POINT"
}
usage() {
cat << _EOF_
USAGE
$(basename "$0") [OPTIONS]
OPTIONS
-h,--help print this help info
-l,--list list mounting point
-m,--mount mount the android phone
-u,--unmount unmount the android phone
_EOF_
}
[ -n "$1" ] || (usage ; exit 0)
while [ -n "$1" ]; do
case "$1" in
-h|--help) usage ;;
-l|--list) list ;;
-m|--mount) mount ;;
-u|--unmount) unmount ;;
*) echo "Invalid options, see --help" ;;
esac
shift
done