summaryrefslogtreecommitdiffstats
path: root/configuration/debian/tedge_agent/postinst
blob: 348ebe12cabe812c97c115225743b9ce1eb4ba66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -e

# Reenable the services only if systemctl is available
if command -v systemctl >/dev/null; then
    ### Enable the sm services if the device is connected to c8y cloud
    if [ -f "/etc/tedge/mosquitto-conf/c8y-bridge.conf" ]; then
        # start and enable tedge-agent
        systemctl start tedge-agent.service
        systemctl enable tedge-agent.service
    fi
fi

# Initialize the agent
sudo -u tedge -- tedge_agent --init

#DEBHELPER#