-
Notifications
You must be signed in to change notification settings - Fork 2
/
drive
executable file
·55 lines (48 loc) · 917 Bytes
/
drive
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
48
49
50
51
52
53
54
55
#!/bin/bash
UMINHO_LOCAL_PATH=$HOME/Documents
UMINHO_REMOTE_PATH="Universidade do Minho/Mestrado Integrado em Engenharia Informática/3. Ano/2. Semestre"
function display_help() {
cat <<EOF
drive sync
drive check | diff
- (university, um, documents)
drive -h, --help
EOF
}
function check() {
case $1 in
university | um | documents)
rclone check --verbose -P "$UMINHO_LOCAL_PATH" gdrive:"$UMINHO_REMOTE_PATH"
;;
*)
echo "Unknown check:" "$@"
;;
esac
}
function sync() {
case $1 in
university | um | documents)
rclone sync --verbose -P "$UMINHO_LOCAL_PATH" gdrive:"$UMINHO_REMOTE_PATH"
;;
*)
echo "Unknown sync:" "$@"
;;
esac
}
case $1 in
-h | --help)
display_help
;;
check | diff)
shift 1
check "$@"
;;
sync)
shift 1
sync "$@"
;;
*)
display_help >&2
exit 1
;;
esac