forked from RAKWireless/rak_common_for_gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·66 lines (48 loc) · 1.21 KB
/
install.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
#!/bin/bash
# Stop on the first sign of trouble
set -e
#$1=create_img
SCRIPT_COMMON_FILE=$(pwd)/rak/rak/shell_script/rak_common.sh
source $SCRIPT_COMMON_FILE
rpi_model=`do_get_rpi_model`
INSTALL_CHIRPSTACK=1
CREATE_IMG=""
linenum=`sed -n "/spi/=" $JSON_FILE`
sed -i "${linenum}c\\\\t\"spi\": \"$SPI\"" $JSON_FILE
linenum=`sed -n "/gw_model/=" $JSON_FILE`
sed -i "${linenum}c\\\\t\"gw_model\": \"$GW_MODEL\"," $JSON_FILE
linenum=`sed -n "/install_lte/=" $RAK_GW_JSON`
sed -i "${linenum}c\\\\t\"install_lte\": \"$INSTALL_LTE\"," $RAK_GW_JSON
apt update
#pushd rak
#./install.sh $CREATE_IMG
#sleep 1
#popd
#set +e
#write_json_chirpstack_install $INSTALL_CHIRPSTACK
#set -e
#pushd ap
#./install.sh $CREATE_IMG
#sleep 1
#popd
#if [ "$INSTALL_CHIRPSTACK" = 1 ]; then
# pushd chirpstack
# ./install.sh $CREATE_IMG
# sleep 1
# popd
#fi
#pushd lte
#./install.sh $CREATE_IMG
#sleep 1
#popd
#pushd lora
#./install.sh $CREATE_IMG
#sleep 1
#popd
pushd sysconf
./install.sh $CREATE_IMG
sleep 1
popd
echo_success "*********************************************************"
echo_success "* The RAKwireless gateway is successfully installed! *"
echo_success "*********************************************************"