From 350a736a104efe1ff79528189bdf821be2aaae2c Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Fri, 14 May 2021 07:35:23 -0700 Subject: [PATCH] Ensure stored GUID has value during install. --- Server/wwwroot/Content/Install-MacOS-arm64.sh | 5 ++++- Server/wwwroot/Content/Install-MacOS-x64.sh | 5 ++++- Server/wwwroot/Content/Install-Manjaro-x64.sh | 5 ++++- Server/wwwroot/Content/Install-Ubuntu-x64.sh | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Server/wwwroot/Content/Install-MacOS-arm64.sh b/Server/wwwroot/Content/Install-MacOS-arm64.sh index 246acf71..2069eced 100644 --- a/Server/wwwroot/Content/Install-MacOS-arm64.sh +++ b/Server/wwwroot/Content/Install-MacOS-arm64.sh @@ -37,7 +37,10 @@ su - $SUDO_USER -c "brew install jq" if [ -f "/usr/local/bin/Remotely/ConnectionInfo.json" ]; then - GUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + SavedGUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + if [ -z "$SavedGUID" ]; then + GUID="$SavedGUID" + fi fi rm -r -f /Applications/Remotely diff --git a/Server/wwwroot/Content/Install-MacOS-x64.sh b/Server/wwwroot/Content/Install-MacOS-x64.sh index 06cbbb5c..890c9509 100644 --- a/Server/wwwroot/Content/Install-MacOS-x64.sh +++ b/Server/wwwroot/Content/Install-MacOS-x64.sh @@ -37,7 +37,10 @@ su - $SUDO_USER -c "brew install jq" if [ -f "/usr/local/bin/Remotely/ConnectionInfo.json" ]; then - GUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + SavedGUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + if [ -z "$SavedGUID" ]; then + GUID="$SavedGUID" + fi fi rm -r -f /Applications/Remotely diff --git a/Server/wwwroot/Content/Install-Manjaro-x64.sh b/Server/wwwroot/Content/Install-Manjaro-x64.sh index 8559855e..c190dabc 100644 --- a/Server/wwwroot/Content/Install-Manjaro-x64.sh +++ b/Server/wwwroot/Content/Install-Manjaro-x64.sh @@ -33,7 +33,10 @@ pacman -S jq --noconfirm pacman -S curl --noconfirm if [ -f "/usr/local/bin/Remotely/ConnectionInfo.json" ]; then - GUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + SavedGUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + if [ -z "$SavedGUID" ]; then + GUID="$SavedGUID" + fi fi rm -r -f /usr/local/bin/Remotely diff --git a/Server/wwwroot/Content/Install-Ubuntu-x64.sh b/Server/wwwroot/Content/Install-Ubuntu-x64.sh index 5e45bfd3..64fc44bc 100644 --- a/Server/wwwroot/Content/Install-Ubuntu-x64.sh +++ b/Server/wwwroot/Content/Install-Ubuntu-x64.sh @@ -43,7 +43,10 @@ apt-get -y install curl if [ -f "/usr/local/bin/Remotely/ConnectionInfo.json" ]; then - GUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + SavedGUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'` + if [ -z "$SavedGUID" ]; then + GUID="$SavedGUID" + fi fi rm -r -f /usr/local/bin/Remotely