2022-10-21 04:06:02 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) Edgeless Systems GmbH
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2022-11-10 04:28:35 -05:00
|
|
|
set -euo pipefail
|
|
|
|
shopt -s inherit_errexit
|
|
|
|
|
2022-10-21 04:06:02 -04:00
|
|
|
depends() {
|
|
|
|
echo systemd
|
|
|
|
}
|
|
|
|
|
|
|
|
install_and_enable_unit() {
|
|
|
|
unit="$1"; shift
|
|
|
|
target="$1"; shift
|
2022-11-10 04:28:35 -05:00
|
|
|
inst_simple "${moddir:?}/${unit}" "${systemdsystemunitdir:?}/${unit}"
|
|
|
|
mkdir -p "${initdir:?}${systemdsystemconfdir:?}/${target}.wants"
|
2022-10-21 04:06:02 -04:00
|
|
|
ln_r "${systemdsystemunitdir}/${unit}" \
|
|
|
|
"${systemdsystemconfdir}/${target}.wants/${unit}"
|
|
|
|
}
|
|
|
|
|
|
|
|
install() {
|
|
|
|
inst_multiple \
|
|
|
|
bash \
|
|
|
|
curl \
|
|
|
|
grep \
|
|
|
|
sed
|
|
|
|
|
2022-11-10 04:28:35 -05:00
|
|
|
inst_script "${moddir}/azure-provisioning.sh" \
|
2022-10-21 04:06:02 -04:00
|
|
|
"/usr/local/bin/azure-provisioning"
|
|
|
|
install_and_enable_unit "azure-provisioning.service" \
|
|
|
|
"basic.target"
|
|
|
|
}
|