File tree Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 55
66Help ()
77{
8- echo " Create 3 update script for robots running G.1 .1 or higher"
8+ echo " Create 3 update script for robots running G.2 .1 or higher"
99 echo
1010 echo " usage: bash create_update.sh /path/to/image.swu [-h]"
1111 echo " options:"
Original file line number Diff line number Diff line change @@ -98,8 +98,12 @@ ros2 run robot_upstart install turtlebot4_bringup/launch/$model.launch.py --job
9898
9999sudo systemctl daemon-reload
100100
101- # Copy Wifi script to home directory
102- sudo cp $SETUP_DIR /scripts/wifi.sh ~ /
101+ # Copy Wifi and Create 3 Update scripts to local bin
102+ chmod +x $SETUP_DIR /scripts/wifi.sh
103+ sudo cp $SETUP_DIR /scripts/wifi.sh /usr/local/bin
104+
105+ chmod +x $SETUP_DIR /scripts/create_update.sh
106+ sudo cp $SETUP_DIR /scripts/create_update.sh /usr/local/bin
103107
104108read -p " Installation complete, press enter to reboot."
105109
Original file line number Diff line number Diff line change 2121}
2222
2323ap=0;
24+ create3=0;
2425
25- while getopts " s:p:c:r :ha" flag
26+ while getopts " s:p:cr :ha" flag
2627do
2728 case " ${flag} " in
2829 s) ssid=${OPTARG} ;;
@@ -98,7 +99,7 @@ echo -e "network: \n\
9899
99100# Add regulatory domain
100101
101- # If reg domain already exists, replace it
102+ If reg domain already exists, replace it
102103if grep -Fq " REGDOMAIN=" /etc/default/crda
103104then
104105 sudo sed -i " s/REGDOMAIN=.*/REGDOMAIN=$domain /g" /etc/default/crda
@@ -107,17 +108,30 @@ else
107108fi
108109
109110
110- # If country domain already exists, replace it
111+ If country domain already exists, replace it
111112if grep -Fq " COUNTRY=" /etc/environment
112113then
113114 sudo sed -i " s/COUNTRY=.*/COUNTRY=$domain /g" /etc/environment
114115else
115116 echo " COUNTRY=$domain " | sudo tee -a /etc/environment
116117fi
117118
119+ create3_domain=ETSI;
120+
121+ case $domain in
122+
123+ AS|CA|FM|GU|KY|MP|PR|TW|UM|US|VI)
124+ create3_domain=FCC
125+ ;;
126+
127+ JP)
128+ create3_domain=Japan
129+ ;;
130+ esac
131+
118132if [ $create3 -eq 1 ]
119133then
120- curl -X POST -d " ssid =$ssid &passwd =$password " " http://192.168.186.2/cgi-bin/provisioning "
134+ curl -X POST -d " ssids =$ssid &pass =$password &countryids= $create3_domain " " http://192.168.186.2/wifi-action-change "
121135fi
122136
123137sudo netplan generate
You can’t perform that action at this time.
0 commit comments