diff options
Diffstat (limited to 'configuration')
-rwxr-xr-x | configuration/debian/tedge/postinst | 4 | ||||
-rw-r--r-- | configuration/debian/tedge_mapper/postinst | 11 | ||||
-rw-r--r-- | configuration/debian/tedge_mapper/postrm | 35 |
3 files changed, 46 insertions, 4 deletions
diff --git a/configuration/debian/tedge/postinst b/configuration/debian/tedge/postinst index 08f36052..2f0dfee1 100755 --- a/configuration/debian/tedge/postinst +++ b/configuration/debian/tedge/postinst @@ -25,6 +25,10 @@ install -g tedge -o tedge -m 755 -d /etc/tedge install -g tedge -o tedge -m 755 -d /etc/tedge/mosquitto-conf install -g mosquitto -o mosquitto -m 755 -d /etc/tedge/device-certs +# Create a directory for the operations added by the user. +install -g tedge -o tedge -m 755 -d /etc/tedge/operations +install -g tedge -o tedge -m 755 -d /etc/tedge/plugins + # Create directory for logs install -g tedge -o tedge -m 755 -d /var/log/tedge diff --git a/configuration/debian/tedge_mapper/postinst b/configuration/debian/tedge_mapper/postinst index 17e45367..9e27c5ce 100644 --- a/configuration/debian/tedge_mapper/postinst +++ b/configuration/debian/tedge_mapper/postinst @@ -13,4 +13,15 @@ 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# diff --git a/configuration/debian/tedge_mapper/postrm b/configuration/debian/tedge_mapper/postrm index 942ff29c..eec30fbb 100644 --- a/configuration/debian/tedge_mapper/postrm +++ b/configuration/debian/tedge_mapper/postrm @@ -1,9 +1,36 @@ #!/bin/sh set -e -### Remove user tedge-mapper -if getent passwd tedge-mapper >/dev/null; then - deluser --quiet --system tedge-mapper -fi +remove_tedge_mapper_user() { + if getent passwd tedge-mapper >/dev/null; then + pkill -u tedge-mapper || true + deluser --quiet --system tedge-mapper + fi +} + +purge_operations() { + if [ -d "/etc/tedge/operations" ]; then + rm -rf /etc/tedge/operations + fi +} + +case "$1" in + purge) + remove_tedge_mapper_user + purge_operations + ;; + + remove) + remove_tedge_mapper_user + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "tedge postrm called with unknown argument \`$1\`" >&2 + exit 1 + ;; +esac #DEBHELPER# |