From a4a53ecfa0101f6cf57a8eba73da84e3d426d2a5 Mon Sep 17 00:00:00 2001 From: Michael Kamprath Date: Sun, 10 May 2020 20:34:42 -0700 Subject: [PATCH] improved error handling --- CHANGELOG.md | 1 + deployment-scripts/linode-deploy.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 536781d..72bd2e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Changed * Improved error handling in the RTMP configuration generation script. +* Improved error handling in the Lindode deploy script. ### Fixed * Correct bug in RTMP configuration generation when the audio bit rate is set. diff --git a/deployment-scripts/linode-deploy.sh b/deployment-scripts/linode-deploy.sh index bd75fb3..74c00d2 100755 --- a/deployment-scripts/linode-deploy.sh +++ b/deployment-scripts/linode-deploy.sh @@ -107,8 +107,12 @@ ssh-keyscan -T 240 ${linode_ip_addr} >> ~/.ssh/known_hosts # copy the passed RTMP server config file to the Server echo "Copying '${RTMP_SERVER_CONFIG_FILEPATH}' to path /root/rtmp_server_config.json on Linode ${linode_id}" -scp "$RTMP_SERVER_CONFIG_FILEPATH" root@"${linode_ip_addr}":/root/rtmp_server_config.json - +scp -q "$RTMP_SERVER_CONFIG_FILEPATH" root@"${linode_ip_addr}":/root/rtmp_server_config.json +if [ $? -ne 0 ]; then + echo "ERROR - Unable to copy '${RTMP_SERVER_CONFIG_FILEPATH}' to linode ${linode_id}. Please terminate the Linode with this command:" + echo " linode-cli linodes delete ${linode_id}" + exit 1 +fi # now launch docker container echo "Launch kamprath/multistreaming-server:latest Docker image." docker_proc_id=$(ssh root@"$linode_ip_addr" \