-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect.sh
executable file
·43 lines (37 loc) · 974 Bytes
/
select.sh
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
#!/bin/sh
set -e
SPIDEROAK_ONE="/usr/bin/SpiderOakONE"
if [ "$#" -eq 0 ]; then
"$SPIDEROAK_ONE" --selection
wait
fi
if [ "$#" -eq 1 ] && [ "$1" = "--reset" ]; then
"$SPIDEROAK_ONE" --reset-selection
fi
for arg in "$@"; do
OP="$(echo "$arg" | cut -f 1 -d :)"
ITEM="$(echo "$arg" | cut -f 2- -d :)"
case "$OP" in
Dir|IncludeDir)
"$SPIDEROAK_ONE" --include-dir="$ITEM"
echo "Added Dir: \"$ITEM\""
;;
File|IncludeFile)
"$SPIDEROAK_ONE" --include-file="$ITEM"
echo "Added File: \"$ITEM\""
;;
Exclude|ExcludeDir)
"$SPIDEROAK_ONE" --exclude-dir="$ITEM"
echo "Excluded Dir: \"$ITEM\""
;;
ExcludeFile)
"$SPIDEROAK_ONE" --exclude-file="$ITEM"
echo "Excluded File: \"$ITEM\""
;;
*)
echo "Ignored: \"${arg}\""
;;
esac
wait
sleep 1
done