#!/bin/bash
set -e
create() {
az iot hub device-identity create --device-id "$IOT_EDGE_DEVICE_NAME" --edge-enabled --hub-name "$IOT_HUB_NAME" --output none
# shellcheck disable=SC2162
read
}
read() {
az iot hub device-identity connection-string show --device-id "$IOT_EDGE_DEVICE_NAME" --hub-name "$IOT_HUB_NAME"
}
delete() {
az iot hub device-identity delete --device-id "$IOT_EDGE_DEVICE_NAME" --hub-name "$IOT_HUB_NAME"
}
# Check if the function exists (bash specific)
if declare -f "$1" >/dev/null; then
# call arguments verbatim
"$@"
else
# Show a helpful error
echo "'$1' is not a known function name" >&2
exit 1
fi
I don't even know how to start solving it and I haven't found such an issue with this provider on the internet. There were some similar topics abour remote-exec and users were just adding chmod -x to the command but I can't see a way to do this here.
I have created a script to create Azure IoT Device based on this topic.
RESOURCE
SCRIPT
Every try ends up with an ERROR
I don't even know how to start solving it and I haven't found such an issue with this
provider
on the internet. There were some similar topics abourremote-exec
and users were just addingchmod -x
to thecommand
but I can't see a way to do this here.