-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathquick-rg.sh
executable file
·103 lines (93 loc) · 1.69 KB
/
quick-rg.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
RG350_HOME="/media/data/local/home"
LAUNCHER="/usr/local/sbin/frontend_start"
RG350_IP="[email protected]"
# probably don't edit below here
scp=`which scp`
if [ $? -ne 0 ]; then
echo "This script requires scp"
exit 1
fi
function makeOpk {
echo "building the opk"
rm -f ./output/images/*.opk
./board/opendingux/gcw0/make_upgrade.sh
if [ $? -ne 0 ]; then
echo "making opk failed"
exit 1
fi
return $?
}
function copyOpk {
echo "doing a quick copy of the opk to the rg-350"
cmd="scp ./output/images/*.opk ${RG350_IP}:${RG350_HOME}/"
echo ${cmd}
${cmd}
return $?
}
function showHelp {
echo "Usage:"
echo " -h Display this help message."
echo " -f Full clean, build, deploy, enable."
echo " -n Nuclear. Delete cached downloads as well....."
echo " -q Quick, build, deploy binary only."
echo " -c deploy last opk"
}
function myMake {
args="$*"
cmd="make BR2_EXTERNAL=board/opendingux ${args}"
echo "make command : ${cmd}"
${cmd}
if [ $? -ne 0 ]; then
echo "make failed"
exit 1
fi
}
if [ $# -eq 0 ]; then
showHelp
exit 0
fi
while getopts ":hfnqc" opt; do
case ${opt} in
h )
showHelp
exit 0
;;
f )
myMake "clean"
myMake "rg350_defconfig"
myMake
makeOpk
copyOpk
exit 0
;;
n )
rm -rf ./dl
myMake "clean"
myMake "rg350_defconfig"
myMake
makeOpk
copyOpk
exit 0
;;
q )
myMake
makeOpk
copyOpk
exit 0
;;
c )
makeOpk
copyOpk
exit 0
;;
\? )
showHelp
;;
: )
echo "Invalid option: $OPTARG requires an argument" 1>&2
showHelp
;;
esac
done
shift $((OPTIND -1))