File: init

package info (click to toggle)
mosquitto 2.0.22-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,572 kB
  • sloc: ansic: 51,107; python: 15,095; xml: 7,187; makefile: 1,819; cpp: 1,541; sh: 320; perl: 70
file content (26 lines) | stat: -rwxr-xr-x 583 bytes parent folder | download
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
#!/bin/sh

export CONF=$1        # %E
export RUN=$2         # %t 
export STATE=$3       # %S
export LOG=$4         # %L

# $RUN is on tmpfs
mkdir -m 750 -p "${RUN}"/mosquitto

# Do not overwrite anything else to preserve user changes

if [ ! -d "${LOG}"/mosquitto ]; then
	mkdir -m 750 -p "${LOG}"/mosquitto
fi

if [ ! -d "${STATE}"/mosquitto ]; then
	mkdir -m 750 -p "${STATE}"/mosquitto
fi

if [ ! -f "${CONF}"/mosquitto/mosquitto.conf ]; then
	mkdir -m 750 "${CONF}"/mosquitto
	envsubst < /usr/share/mosquitto/user/config/mosquitto.conf > "${CONF}"/mosquitto/mosquitto.conf 
fi