forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish_packages
executable file
·90 lines (83 loc) · 1.53 KB
/
publish_packages
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
#!/bin/zsh
current=$(git --git-dir=./env/.git rev-parse --abbrev-ref HEAD)
B=("${(@s/_/)current}")
VERSION=$B[1]
MODEL=$B[2]
while getopts "a:m:r:" OPTION
do
case $OPTION in
a)
ARCH=$OPTARG
;;
m)
MODEL=$OPTARG
;;
r)
VERSION=$OPTARG
;;
?)
exit
;;
esac
done
case $MODEL in
tplink)
ARCH="ar71xx"
;;
ac)
ARCH="bcm53xx"
;;
x86)
ARCH="x86"
;;
dlink)
ARCH="ath79"
;;
dwr921)
ARCH="ramips"
;;
esac
if [ -z $VERSION ]
then
echo VERSIE niet opgegeven!
exit
fi
currdir=$(pwd)
cd ~/Projects/openwrt
make package/index
case $VERSION in
v2)
case $ARCH in
ar71xx|bcm53xx|ath79)
cd bin/targets/$ARCH/generic/packages
scp -r * api:/var/www/dl/targets/$ARCH/generic/packages
;;
ramips)
cd bin/targets/ramips/mt7620/packages
scp -r * api:/var/www/dl/targets/ramips/mt7620/packages
;;
x86)
cd bin/targets/x86/64/packages
scp -r * api:/var/www/dl/targets/x86/64/packages
;;
* ) echo Skipped;;
esac
;;
* )
case $ARCH in
ar71xx|bcm53xx|ath79)
cd bin/targets/$ARCH/generic/packages
scp -r * herman@gratwifi:apps/gratwifi/current/public/files/openwrt/targets/$ARCH/generic/packages
;;
ramips)
cd bin/targets/ramips/mt7620/packages
scp -r * herman@gratwifi:apps/gratwifi/current/public/files/openwrt/targets/ramips/mt7620/packages
;;
x86)
cd bin/targets/x86/64/packages
scp -r * herman@gratwifi:apps/gratwifi/current/public/files/openwrt/targets/x86/64/packages
;;
* ) echo Skipped;;
esac
esac
cd $currdir