12345678910111213141516171819202122 |
- #!/bin/bash
- #Item3 MQTT
- # install&setting mqtt server
- sudo -H pip3 install paho-mqtt
- sudo apt-get install mosquitto -y
- sudo systemctl start mosquitto
- sudo ufw allow 1883/tcp
- sudo ufw allow 8080/tcp
- # get mqtt server file mosquitto.conf
- # get mqtt server file passwd.conf
- cd /home/使用者;pwd;sudo git clone -b mosquitto --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /home/使用者/mosquitto/;sudo git clone -b passwd --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /home/使用者/passwd/;sudo mv /home/使用者/mosquitto/mosquitto.conf /etc/mosquitto/;sudo mv /home/使用者/passwd/passwd /etc/mosquitto/;sudo rm -rf /home/使用者/mosquitto/;sudo rm -rf /home/使用者/passwd/;pwd
- sudo systemctl restart mosquitto
- echo "mqtt server file done"
|