summaryrefslogtreecommitdiffstats
path: root/configuration/debian/tedge_mapper/postinst
blob: 9e27c5cee99aadd7f089422830adf3a332888273 (plain)
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
#!/bin/sh

set -e

### Create a group "tedge-mapper" if not created before
if ! getent group tedge-mapper >/dev/null; then
    addgroup --quiet --system tedge-mapper
fi

### Create a user "tedge-mapper" if not created before
# Create user tedge-mapper with no home(--no-create-home), no login(--shell) and in group tedge(--ingroup)
if ! getent passwd tedge-mapper >/dev/null; then
    adduser --quiet --system --no-create-home --ingroup tedge-mapper --shell /usr/sbin/nologin tedge-mapper
fi

### Create supported cloud operations directories
install -g tedge -o tedge -m 755 -d /etc/tedge/operations/c8y
install -g tedge -o tedge -m 755 -d /etc/tedge/operations/az

### Create operation file.
# This allows thin-edge.io components to list and declare supported operations for the cloud provider.
# Some of the examples for Cumulocity IoT supported opertations: https://cumulocity.com/api/10.11.0/#section/Device-management-library/Miscellaneous
install -g tedge -o tedge -m 664 /dev/null /etc/tedge/operations/c8y/c8y_SoftwareUpdate
install -g tedge -o tedge -m 664 /dev/null /etc/tedge/operations/c8y/c8y_Restart
install -g tedge -o tedge -m 664 /dev/null /etc/tedge/operations/c8y/c8y_LogfileRequest

#DEBHELPER#