install_mosquitto_mqtt.sh 877 Bytes
Newer Older
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
1
2
3
4
5
6
7
#!/bin/sh

add-apt-repository ppa:mosquitto-dev/mosquitto-ppa -y

apt-get update -y
apt-get install mosquitto -y

8
9
10
11
echo "mosquitto installed"

service mosquitto stop

Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
echo "
# /etc/mosquitto/mosquitto.conf
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

log_type all
connection_messages true
log_timestamp true
log_dest file /var/log/mosquitto/mosquitto.log

# Standard MQTT
listener 1883
protocol mqtt

# MQTT over websockets
listener 8000
protocol websockets

include_dir /etc/mosquitto/conf.d
35
36
37
max_inflight_messages 0
max_queued_messages 0
max_connections  -1
Vladimir Kiryakov's avatar
Vladimir Kiryakov committed
38
39
" > /etc/mosquitto/mosquitto.conf

40
41
42
43
echo "/etc/mosquitto/mosquitto.conf has been changed"

service mosquitto start

Spencer Williams's avatar
linting    
Spencer Williams committed
44
echo "mosquitto installed and configured"