From afe76af6792d260edc8f082188550a5431a36ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 23 Dec 2021 12:30:58 +0100 Subject: [PATCH] __matterbridge: add support for ubuntu, fix configuration via STDIN --- type/__matterbridge/manifest | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/type/__matterbridge/manifest b/type/__matterbridge/manifest index ef02112..2b5738b 100755 --- a/type/__matterbridge/manifest +++ b/type/__matterbridge/manifest @@ -20,7 +20,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - debian) + debian|ubuntu) # This type assume systemd for service installation. ;; *) @@ -31,11 +31,13 @@ case "$os" in esac # Required parameters. -VERSION=$(cat "$__object/parameter/version") +version=$(cat "$__object/parameter/version") if [ -f "$__object/parameter/config" ]; then - CONFIG="$(cat "$__object/parameter/config")" - if [ "$CONFIG" = "-" ]; then - CONFIG=$(cat "$__object/stdin") + config="$(cat "$__object/parameter/config")" + if [ "$config" = "-" ]; then + mkdir -p "$__object/files" + config="$__object/files/matterbridge.toml" + cat "$__object/stdin" > "$config" fi fi @@ -46,11 +48,11 @@ export USER=matterbridge export GROUP=$USER # Internal variables. -artefact="matterbridge-$VERSION-linux-64bit" +artefact="matterbridge-$version-linux-64bit" checksum_file="checksums.txt" release_download_url=https://github.com/42wim/matterbridge/releases/download -binary_url="$release_download_url/v$VERSION/$artefact" -checksum_file_url="$release_download_url/v$VERSION/$checksum_file" +binary_url="$release_download_url/v$version/$artefact" +checksum_file_url="$release_download_url/v$version/$checksum_file" config_dir=$(dirname $CONFIG_PATH) systemd_unit_path='/etc/systemd/system/matterbridge.service' @@ -88,7 +90,7 @@ require="__user/$USER" __directory "$config_dir" \ require="__directory/$config_dir" __file "$CONFIG_PATH" \ --owner "$USER" \ --mode 0640 \ - --source "$CONFIG" + --source "$config" __file "$systemd_unit_path" \ --source "$__object/files/matterbridge.service"