From 4b4ea3fbc2c0a227adc5c41dbe15070b66746052 Mon Sep 17 00:00:00 2001 From: reubenmiller Date: Mon, 22 Jun 2026 17:14:16 +0200 Subject: [PATCH] chore: remove legacy c8y-command-plugin The c8y-command-plugin package has been superseded by tedge-command-plugin and is no longer built or shipped. Remove its source files, nfpm packaging config, and README references. The replaces/provides directives in nfpm.tedge-command-plugin.yaml are kept so existing devices still upgrade cleanly from the old package. Co-Authored-By: Claude Opus 4.8 --- README.md | 12 +----- nfpm.c8y-command-plugin.yaml | 36 ----------------- src/c8y-command-plugin/c8y-command | 64 ------------------------------ src/c8y-command-plugin/c8y_Command | 4 -- 4 files changed, 1 insertion(+), 115 deletions(-) delete mode 100644 nfpm.c8y-command-plugin.yaml delete mode 100755 src/c8y-command-plugin/c8y-command delete mode 100644 src/c8y-command-plugin/c8y_Command diff --git a/README.md b/README.md index 3dd28e9..3bfadbd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# c8y-command-plugin +# tedge-command-plugin thin-edge.io Cumulocity IoT shell plugin to process the `c8y_Command` operation. @@ -24,16 +24,6 @@ The following details the technical aspects of the plugin to get an idea what sy The following linux package formats are provided on the releases page and also in the [tedge-community](https://cloudsmith.io/~thinedge/repos/community/packages/) repository: -**c8y-command-plugin** - -**Warning:** This version is compatible with thin-edge.io > 1.0.0, but is now deprecated. Please upgrade to thin-edge.io >= 1.4.0 and use the new tedge-command-plugin instead. - -|Operating System|Repository link| -|--|--| -|Debian/Raspian (deb)|[![Latest version of 'c8y-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/deb/c8y-command-plugin/latest/a=all;d=any-distro%252Fany-version;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/deb/c8y-command-plugin/latest/a=all;d=any-distro%252Fany-version;t=binary/)| -|Alpine Linux (apk)|[![Latest version of 'c8y-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/alpine/c8y-command-plugin/latest/a=noarch;d=alpine%252Fany-version/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/alpine/c8y-command-plugin/latest/a=noarch;d=alpine%252Fany-version/)| -|RHEL/CentOS/Fedora (rpm)|[![Latest version of 'c8y-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/rpm/c8y-command-plugin/latest/a=noarch;d=any-distro%252Fany-version;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/rpm/c8y-command-plugin/latest/a=noarch;d=any-distro%252Fany-version;t=binary/)| - **tedge-command-plugin** **Warning:** This version is only compatible with thin-edge.io >= 1.4.0. diff --git a/nfpm.c8y-command-plugin.yaml b/nfpm.c8y-command-plugin.yaml deleted file mode 100644 index 1729cdf..0000000 --- a/nfpm.c8y-command-plugin.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: c8y-command-plugin -arch: all -platform: linux -version: ${SEMVER} -section: misc -priority: optional -maintainer: thin-edge.io -description: thin-edge.io Shell/Command operation plugin -vendor: thin-edge.io -homepage: https://github.com/thin-edge/c8y-command-plugin -license: MIT -apk: - # Use noarch instead of "all" - arch: noarch -contents: - - src: ./src/c8y-command-plugin/c8y_Command - dst: /etc/tedge/operations/c8y/c8y_Command - file_info: - mode: 0644 - owner: tedge - group: tedge - - - src: ./src/c8y-command-plugin/c8y-command - dst: /usr/bin/c8y-command - file_info: - mode: 0755 - owner: tedge - group: tedge - - - src: ./src/env - dst: /etc/c8y-command-plugin/env - type: config|noreplace - file_info: - mode: 0644 - owner: tedge - group: tedge diff --git a/src/c8y-command-plugin/c8y-command b/src/c8y-command-plugin/c8y-command deleted file mode 100755 index 462506b..0000000 --- a/src/c8y-command-plugin/c8y-command +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -set -e - -info() { - echo "$(date --iso-8601=seconds 2>/dev/null || date +%Y-%m-%dT%H:%M:%S%z 2>/dev/null ||:) INFO $*" >&2 -} - -info "Received message: $*" - -# Parse the smart rest message, ignore the first two field, and everything afterwards is the command -COMMAND="${1#*,*,}" - -# Check if command is wrapped with quotes, if so then remove them -# Use a case statement, as it is posix compatible -case "$COMMAND" in - '"'*'"') - # Remove the first char - COMMAND="${COMMAND#?}" - # Remove the last char - COMMAND="${COMMAND%?}" - ;; -esac - -# Default values (can be overridden by the settings file) -SHELL_OPTIONS="bash sh" -SHELL_BIN= - -# Load settings file -SETTINGS_FILE=/etc/c8y-command-plugin/env -if [ -f "$SETTINGS_FILE" ]; then - FOUND_FILE=$(find "$SETTINGS_FILE" -perm 644 | head -n1) - - if [ -n "$FOUND_FILE" ]; then - info "Loading settings: $FOUND_FILE" - # shellcheck disable=SC1090 - . "$FOUND_FILE" ||: - fi -fi - -# Auto detect the shell. Match on the first available shell -# If the shell bin is invalid, then just let it fail (this might be useful to disable the shell function on the device) -if [ -z "$SHELL_BIN" ]; then - for NAME in $SHELL_OPTIONS; do - if command -V "$NAME" >/dev/null 2>&1; then - SHELL_BIN="$NAME" - break - fi - done -fi - -if [ -z "$SHELL_BIN" ]; then - SHELL_BIN="sh" -fi - -info "Using shell: $SHELL_BIN" - -EXIT_CODE=0 -"$SHELL_BIN" -c "$COMMAND" || EXIT_CODE=$? - -if [ "${EXIT_CODE}" -ne 0 ]; then - info "Command returned a non-zero exit code. code=$EXIT_CODE" -fi - -exit "$EXIT_CODE" diff --git a/src/c8y-command-plugin/c8y_Command b/src/c8y-command-plugin/c8y_Command deleted file mode 100644 index 372b05e..0000000 --- a/src/c8y-command-plugin/c8y_Command +++ /dev/null @@ -1,4 +0,0 @@ -[exec] -topic = "c8y/s/ds" -on_message = "511" -command = "/usr/bin/c8y-command" \ No newline at end of file