-
Notifications
You must be signed in to change notification settings - Fork 6
/
update-resource.sh
executable file
·72 lines (64 loc) · 1.56 KB
/
update-resource.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
username='dev'
password=''
usage() {
echo "usage: update-resource.sh <branchname> [--all|--kpe|--nec|--speller-support|--ise|--sim]"
echo " <branchname> will include 'kite-1', 'kite-2', etc.."
echo " no module specific means all(--all)"
}
if [ $# -lt 1 ] || [ $# -gt 2 ]
then
usage
exit 0
fi
if [ $# -eq 1 ] && [ "$1" = '--help' ]
then
usage
exit 0
fi
home=`dirname "$0"`
home=`cd "$home"; pwd`
if [ -d "$home/package/resource" ]
then
a=1
else
mkdir -p "$home/package/resource"
fi
if [ $# -eq 2 ]
then
dir_name=''
if [ "$2" = '--kpe' ]
then
dir_name='kpe'
elif [ "$2" = '--nec' ]
then
dir_name='nec'
elif [ "$2" = '--speller-support' ]
then
dir_name='speller-support'
elif [ "$2" = '--ise' ]
then
dir_name='ise'
elif [ "$2" = '--sim' ]
then
dir_name='sim'
elif [ "$2" = '--all' ]
then
dir_name='all'
fi
if [ "$dir_name" != "" ] && [ "$dir_name" != "all" ]
then
# echo "rsyncing $dir_name only, type the password: $password"
rsync -azvP --delete "[email protected]:/data/sf1r-resource/$1/resource/$dir_name/" "$home/package/resource/$dir_name/"
elif [ "$dir_name" = "all" ]
then
# echo "rsyncing all, type the password: $password"
rsync -azvP --delete "[email protected]:/data/sf1r-resource/$1/resource/" "$home/package/resource/"
else
echo "unknow module: $2"
usage
fi
else
# echo "rsyncing all, type the password: $password"
rsync -azvP --delete "[email protected]:/data/sf1r-resource/$1/resource/" "$home/package/resource/"
fi