-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsatis-upd.sh
executable file
·46 lines (40 loc) · 1020 Bytes
/
satis-upd.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
#!/bin/bash
#
# satis-upd.sh This shell script used for updatingsatis priavte repository
#
# Set up a default search path.
PATH="/usr/local/bin/:/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
SATIS_EXEC=/usr/local/bin/satis
SATIS_CONFIG=(
"/usr/local/satis/build/inner.json"
"/usr/local/satis/build/mirror.json"
)
LOG_FILE=/var/log/satis.log
headshow(){
datetime=`date "+%Y-%m-%d %H:%M:%S"`
echo "-----------------------------------"
echo "Update satis configure file: $1"
echo ${datetime}
echo "-----------------------------------"
}
footshow(){
datetime=`date "+%Y-%m-%d %H:%M:%S"`
echo "-----------------------------------"
echo "Update finish : ${datetime} "
echo "-----------------------------------"
}
update() {
stcf=$1
headshow $stcf
if [ ! -f "$stcf" ]; then
echo "Config file $stcf not exist!"
return 1
fi
$SATIS_EXEC build $1 -vvv
footshow
}
for cf in ${SATIS_CONFIG[@]};
do
update $cf >> $LOG_FILE 2>&1
done