From: Dermot Bradley Date: Thu, 22 July 2021 00:49 +0100 Subject: [PATCH] cloud-init: Rewrite hook-hotplug to not be Bash-specific Rewrite shellscript to not be Bash-specific --- diff -aur a/tools/hook-hotplug b/tools/hook-hotplug --- a/tools/hook-hotplug +++ b/tools/hook-hotplug @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # This file is part of cloud-init. See LICENSE file for license information. # This script checks if cloud-init has hotplug hooked and if @@ -11,12 +11,12 @@ if is_finished; then # open cloud-init's hotplug-hook fifo rw exec 3<>/run/cloud-init/hook-hotplug-cmd - env_params=( - --subsystem="${SUBSYSTEM}" - handle - --devpath="${DEVPATH}" - --udevaction="${ACTION}" - ) + env_params=" \ + --subsystem=\"${SUBSYSTEM}\" \ + handle \ + --devpath=\"${DEVPATH}\" \ + --udevaction=\"${ACTION}\" \ + " # write params to cloud-init's hotplug-hook fifo - echo "${env_params[@]}" >&3 + echo "${env_params}" >&3 fi