diff --git a/releases/R2023b/scripts/initAdminVM.sh b/releases/R2023b/scripts/initAdminVM.sh new file mode 100644 index 0000000..2daf401 --- /dev/null +++ b/releases/R2023b/scripts/initAdminVM.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +WORKSPACE=/opt/mathworks + +# $0 is the file name + +storageAccountName="$1" +dbConnectionString="$2" +mpsEndpoint="$3" +CIDRRange="$4" +cloudPlatform="$5" +osPlatform="$6" +ikey="$7" +resourceGroup="$8" +subscriptionID="$9" +userName="${10}" +passWord="${11}" +redisName="${12}" +gatewayPrivateIP="${13}" +offerType="${14}" + +azEnvironment=$(sudo curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.azEnvironment') + +echo "$storageAccountName" +echo "$dbConnectionString" +echo "$mpsEndpoint" +echo "$CIDRRange" +echo "$cloudPlatform" +echo "$osPlatform" +echo "$ikey" +echo "$resourceGroup" +echo "$subscriptionID" +echo "$userName" +echo "$redisName" +echo "$gatewayPrivateIP" +echo "$offerType" +echo "$azEnvironment" + +JSONCMD=' +{ + "storageAccountName": "'"$storageAccountName"'", + "dbConnectionString": "'"$dbConnectionString"'", + "mpsEndPoint": "'"$mpsEndpoint"'", + "CIDRRange": "'"$CIDRRange"'", + "cloudPlatform": "'"$cloudPlatform"'", + "osPlatform": "'"$osPlatform"'", + "ikey": "'"$ikey"'", + "resourceGroup": "'"$resourceGroup"'", + "subscriptionID": "'"$subscriptionID"'", + "redisCacheName": "'"$redisName"'", + "gatewayPrivateIP": "'"$gatewayPrivateIP"'", + "offerType": "'"$offerType"'", + "azEnvironment": "'"$azEnvironment"'" +} +' + +destination=$WORKSPACE/controller/dynamicOptions.json +rm $destination + +echo $JSONCMD >> $destination + +echo "Written Config File successfully" + +cd $WORKSPACE/cloud/main +node $WORKSPACE/cloud/main/server/hash_pw.js "${userName}" "${passWord}" "${passWord}" + +echo "Written sudo passwd successfully" + +cp ./.shadow ./bin/. + +echo "Copied shadow file" + +systemctl restart refarchcontroller + +echo "Restarted daemon successfully!" + + +# chown to this user /opt/mathworks +# Clear history +history -c + +echo "Cleared History!" +# File Location +#https://mwstorage24.blob.core.windows.net/azuretemplates/initVm.sh \ No newline at end of file diff --git a/releases/R2023b/scripts/scriptScaleSet.ps1 b/releases/R2023b/scripts/scriptScaleSet.ps1 new file mode 100644 index 0000000..13679b3 --- /dev/null +++ b/releases/R2023b/scripts/scriptScaleSet.ps1 @@ -0,0 +1,55 @@ +<# + .SYNOPSIS + This Script runs on MPS instances +#> + +# Param ( +# [Parameter(Mandatory=$False)][string]$SERVER_MODE +# ) + +# disable automatic updates +Echo "disabling automatic updates" +$service = Get-WmiObject Win32_Service -Filter 'Name="wuauserv"' +if ($service) +{ + if ($service.StartMode -ne "Disabled") + { + $result = $service.ChangeStartMode("Disabled").ReturnValue + if($result) + { + Echo "Failed to disable the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to disable the 'wuauserv' service."} + + if ($service.State -eq "Running") + { + $result = $service.StopService().ReturnValue + if ($result) + { + Echo "Failed to stop the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to stop the 'wuauserv' service."} + } + } + else {Echo "The 'wuauserv' service is already disabled."} +} +else {Echo "Failed to retrieve the service 'wuauserv'."} + +#Disable Automatic Windows Updates +Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AUOptions -Value 1 + +# exclude .ctf file from windows defender scanning +#Add-MpPreference -ExclusionExtension ".ctf" + +#Get-ChildItem "C:\Program Files\MATLAB\MATLAB Runtime\" -Directory | +# ForEach-Object { +# Echo ($_.FullName + '\bin\win64\extractCTF.exe') +# Add-MpPreference -ExclusionProcess ($_.FullName + '\bin\win64\extractCTF.exe') +# } + +Stop-Service -Name Spooler -Force + +Set-Service -Name Spooler -StartupType Disabled + +# Execute reboot required for domain join +#Restart-Computer \ No newline at end of file diff --git a/releases/R2023b/scripts/scriptScaleSet.sh b/releases/R2023b/scripts/scriptScaleSet.sh new file mode 100644 index 0000000..0756b4d --- /dev/null +++ b/releases/R2023b/scripts/scriptScaleSet.sh @@ -0,0 +1,3 @@ +#! /bin/bash +#Put your extra commands here +ls \ No newline at end of file diff --git a/releases/R2024a/scripts/initAdminVM.sh b/releases/R2024a/scripts/initAdminVM.sh new file mode 100644 index 0000000..84558b9 --- /dev/null +++ b/releases/R2024a/scripts/initAdminVM.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +WORKSPACE=/opt/mathworks + +LOG_DIR=/var/log/custom_script +LOG_FILE=$LOG_DIR/custom_script.log + +# Create log directory and file +sudo mkdir -p $LOG_DIR +sudo touch $LOG_FILE +sudo chmod 666 $LOG_FILE + +# $0 is the file name + +storageAccountName="$1" +dbConnectionString="$2" +mpsEndpoint="$3" +CIDRRange="$4" +cloudPlatform="$5" +osPlatform="$6" +ikey="$7" +resourceGroup="$8" +subscriptionID="$9" +userName="${10}" +passWord="${11}" +redisName="${12}" +gatewayPrivateIP="${13}" +offerType="${14}" + +azEnvironment=$(sudo curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.azEnvironment') + +echo "$storageAccountName" +echo "$dbConnectionString" +echo "$mpsEndpoint" +echo "$CIDRRange" +echo "$cloudPlatform" +echo "$osPlatform" +echo "$ikey" +echo "$resourceGroup" +echo "$subscriptionID" +echo "$userName" +echo "$redisName" +echo "$gatewayPrivateIP" +echo "$offerType" +echo "$azEnvironment" + +JSONCMD=' +{ + "storageAccountName": "'"$storageAccountName"'", + "dbConnectionString": "'"$dbConnectionString"'", + "mpsEndPoint": "'"$mpsEndpoint"'", + "CIDRRange": "'"$CIDRRange"'", + "cloudPlatform": "'"$cloudPlatform"'", + "osPlatform": "'"$osPlatform"'", + "ikey": "'"$ikey"'", + "resourceGroup": "'"$resourceGroup"'", + "subscriptionID": "'"$subscriptionID"'", + "redisCacheName": "'"$redisName"'", + "gatewayPrivateIP": "'"$gatewayPrivateIP"'", + "offerType": "'"$offerType"'", + "azEnvironment": "'"$azEnvironment"'" +} +' + +destination=$WORKSPACE/controller/dynamicOptions.json +rm $destination + +echo $JSONCMD >> $destination + +echo "Written Config File successfully" + +cd $WORKSPACE/cloud/main +node $WORKSPACE/cloud/main/server/hash_pw.js "${userName}" "${passWord}" "${passWord}" + +echo "Written sudo passwd successfully" + +cp ./.shadow ./bin/. + +echo "Copied shadow file" + +# Update package lists and log errors +sudo apt-get update 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt update failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +# Install openssh-server and log errors +sudo apt-get install -y openssh-server 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt install failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +systemctl restart refarchcontroller + +echo "Restarted daemon successfully!" + + +# chown to this user /opt/mathworks +# Clear history +history -c + +echo "Cleared History!" +# File Location +#https://mwstorage24.blob.core.windows.net/azuretemplates/initVm.sh \ No newline at end of file diff --git a/releases/R2024a/scripts/scriptScaleSet.ps1 b/releases/R2024a/scripts/scriptScaleSet.ps1 new file mode 100644 index 0000000..13679b3 --- /dev/null +++ b/releases/R2024a/scripts/scriptScaleSet.ps1 @@ -0,0 +1,55 @@ +<# + .SYNOPSIS + This Script runs on MPS instances +#> + +# Param ( +# [Parameter(Mandatory=$False)][string]$SERVER_MODE +# ) + +# disable automatic updates +Echo "disabling automatic updates" +$service = Get-WmiObject Win32_Service -Filter 'Name="wuauserv"' +if ($service) +{ + if ($service.StartMode -ne "Disabled") + { + $result = $service.ChangeStartMode("Disabled").ReturnValue + if($result) + { + Echo "Failed to disable the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to disable the 'wuauserv' service."} + + if ($service.State -eq "Running") + { + $result = $service.StopService().ReturnValue + if ($result) + { + Echo "Failed to stop the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to stop the 'wuauserv' service."} + } + } + else {Echo "The 'wuauserv' service is already disabled."} +} +else {Echo "Failed to retrieve the service 'wuauserv'."} + +#Disable Automatic Windows Updates +Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AUOptions -Value 1 + +# exclude .ctf file from windows defender scanning +#Add-MpPreference -ExclusionExtension ".ctf" + +#Get-ChildItem "C:\Program Files\MATLAB\MATLAB Runtime\" -Directory | +# ForEach-Object { +# Echo ($_.FullName + '\bin\win64\extractCTF.exe') +# Add-MpPreference -ExclusionProcess ($_.FullName + '\bin\win64\extractCTF.exe') +# } + +Stop-Service -Name Spooler -Force + +Set-Service -Name Spooler -StartupType Disabled + +# Execute reboot required for domain join +#Restart-Computer \ No newline at end of file diff --git a/releases/R2024a/scripts/scriptScaleSet.sh b/releases/R2024a/scripts/scriptScaleSet.sh new file mode 100644 index 0000000..6b4f442 --- /dev/null +++ b/releases/R2024a/scripts/scriptScaleSet.sh @@ -0,0 +1,23 @@ +#! /bin/bash +#Put your extra commands here +LOG_DIR=/var/log/custom_script +LOG_FILE=$LOG_DIR/custom_script.log + +# Create log directory and file +sudo mkdir -p $LOG_DIR +sudo touch $LOG_FILE +sudo chmod 666 $LOG_FILE + +# Update package lists and log errors +sudo apt-get update 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt update failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +# Install openssh-server and log errors +sudo apt-get install -y openssh-server 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt install failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +ls \ No newline at end of file diff --git a/releases/R2024b/scripts/initAdminVM.sh b/releases/R2024b/scripts/initAdminVM.sh new file mode 100644 index 0000000..84558b9 --- /dev/null +++ b/releases/R2024b/scripts/initAdminVM.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +WORKSPACE=/opt/mathworks + +LOG_DIR=/var/log/custom_script +LOG_FILE=$LOG_DIR/custom_script.log + +# Create log directory and file +sudo mkdir -p $LOG_DIR +sudo touch $LOG_FILE +sudo chmod 666 $LOG_FILE + +# $0 is the file name + +storageAccountName="$1" +dbConnectionString="$2" +mpsEndpoint="$3" +CIDRRange="$4" +cloudPlatform="$5" +osPlatform="$6" +ikey="$7" +resourceGroup="$8" +subscriptionID="$9" +userName="${10}" +passWord="${11}" +redisName="${12}" +gatewayPrivateIP="${13}" +offerType="${14}" + +azEnvironment=$(sudo curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.azEnvironment') + +echo "$storageAccountName" +echo "$dbConnectionString" +echo "$mpsEndpoint" +echo "$CIDRRange" +echo "$cloudPlatform" +echo "$osPlatform" +echo "$ikey" +echo "$resourceGroup" +echo "$subscriptionID" +echo "$userName" +echo "$redisName" +echo "$gatewayPrivateIP" +echo "$offerType" +echo "$azEnvironment" + +JSONCMD=' +{ + "storageAccountName": "'"$storageAccountName"'", + "dbConnectionString": "'"$dbConnectionString"'", + "mpsEndPoint": "'"$mpsEndpoint"'", + "CIDRRange": "'"$CIDRRange"'", + "cloudPlatform": "'"$cloudPlatform"'", + "osPlatform": "'"$osPlatform"'", + "ikey": "'"$ikey"'", + "resourceGroup": "'"$resourceGroup"'", + "subscriptionID": "'"$subscriptionID"'", + "redisCacheName": "'"$redisName"'", + "gatewayPrivateIP": "'"$gatewayPrivateIP"'", + "offerType": "'"$offerType"'", + "azEnvironment": "'"$azEnvironment"'" +} +' + +destination=$WORKSPACE/controller/dynamicOptions.json +rm $destination + +echo $JSONCMD >> $destination + +echo "Written Config File successfully" + +cd $WORKSPACE/cloud/main +node $WORKSPACE/cloud/main/server/hash_pw.js "${userName}" "${passWord}" "${passWord}" + +echo "Written sudo passwd successfully" + +cp ./.shadow ./bin/. + +echo "Copied shadow file" + +# Update package lists and log errors +sudo apt-get update 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt update failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +# Install openssh-server and log errors +sudo apt-get install -y openssh-server 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt install failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +systemctl restart refarchcontroller + +echo "Restarted daemon successfully!" + + +# chown to this user /opt/mathworks +# Clear history +history -c + +echo "Cleared History!" +# File Location +#https://mwstorage24.blob.core.windows.net/azuretemplates/initVm.sh \ No newline at end of file diff --git a/releases/R2024b/scripts/scriptScaleSet.ps1 b/releases/R2024b/scripts/scriptScaleSet.ps1 new file mode 100644 index 0000000..13679b3 --- /dev/null +++ b/releases/R2024b/scripts/scriptScaleSet.ps1 @@ -0,0 +1,55 @@ +<# + .SYNOPSIS + This Script runs on MPS instances +#> + +# Param ( +# [Parameter(Mandatory=$False)][string]$SERVER_MODE +# ) + +# disable automatic updates +Echo "disabling automatic updates" +$service = Get-WmiObject Win32_Service -Filter 'Name="wuauserv"' +if ($service) +{ + if ($service.StartMode -ne "Disabled") + { + $result = $service.ChangeStartMode("Disabled").ReturnValue + if($result) + { + Echo "Failed to disable the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to disable the 'wuauserv' service."} + + if ($service.State -eq "Running") + { + $result = $service.StopService().ReturnValue + if ($result) + { + Echo "Failed to stop the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to stop the 'wuauserv' service."} + } + } + else {Echo "The 'wuauserv' service is already disabled."} +} +else {Echo "Failed to retrieve the service 'wuauserv'."} + +#Disable Automatic Windows Updates +Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AUOptions -Value 1 + +# exclude .ctf file from windows defender scanning +#Add-MpPreference -ExclusionExtension ".ctf" + +#Get-ChildItem "C:\Program Files\MATLAB\MATLAB Runtime\" -Directory | +# ForEach-Object { +# Echo ($_.FullName + '\bin\win64\extractCTF.exe') +# Add-MpPreference -ExclusionProcess ($_.FullName + '\bin\win64\extractCTF.exe') +# } + +Stop-Service -Name Spooler -Force + +Set-Service -Name Spooler -StartupType Disabled + +# Execute reboot required for domain join +#Restart-Computer \ No newline at end of file diff --git a/releases/R2024b/scripts/scriptScaleSet.sh b/releases/R2024b/scripts/scriptScaleSet.sh new file mode 100644 index 0000000..6b4f442 --- /dev/null +++ b/releases/R2024b/scripts/scriptScaleSet.sh @@ -0,0 +1,23 @@ +#! /bin/bash +#Put your extra commands here +LOG_DIR=/var/log/custom_script +LOG_FILE=$LOG_DIR/custom_script.log + +# Create log directory and file +sudo mkdir -p $LOG_DIR +sudo touch $LOG_FILE +sudo chmod 666 $LOG_FILE + +# Update package lists and log errors +sudo apt-get update 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt update failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +# Install openssh-server and log errors +sudo apt-get install -y openssh-server 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt install failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +ls \ No newline at end of file diff --git a/releases/R2025a/scripts/initAdminVM.sh b/releases/R2025a/scripts/initAdminVM.sh new file mode 100644 index 0000000..84558b9 --- /dev/null +++ b/releases/R2025a/scripts/initAdminVM.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +WORKSPACE=/opt/mathworks + +LOG_DIR=/var/log/custom_script +LOG_FILE=$LOG_DIR/custom_script.log + +# Create log directory and file +sudo mkdir -p $LOG_DIR +sudo touch $LOG_FILE +sudo chmod 666 $LOG_FILE + +# $0 is the file name + +storageAccountName="$1" +dbConnectionString="$2" +mpsEndpoint="$3" +CIDRRange="$4" +cloudPlatform="$5" +osPlatform="$6" +ikey="$7" +resourceGroup="$8" +subscriptionID="$9" +userName="${10}" +passWord="${11}" +redisName="${12}" +gatewayPrivateIP="${13}" +offerType="${14}" + +azEnvironment=$(sudo curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.azEnvironment') + +echo "$storageAccountName" +echo "$dbConnectionString" +echo "$mpsEndpoint" +echo "$CIDRRange" +echo "$cloudPlatform" +echo "$osPlatform" +echo "$ikey" +echo "$resourceGroup" +echo "$subscriptionID" +echo "$userName" +echo "$redisName" +echo "$gatewayPrivateIP" +echo "$offerType" +echo "$azEnvironment" + +JSONCMD=' +{ + "storageAccountName": "'"$storageAccountName"'", + "dbConnectionString": "'"$dbConnectionString"'", + "mpsEndPoint": "'"$mpsEndpoint"'", + "CIDRRange": "'"$CIDRRange"'", + "cloudPlatform": "'"$cloudPlatform"'", + "osPlatform": "'"$osPlatform"'", + "ikey": "'"$ikey"'", + "resourceGroup": "'"$resourceGroup"'", + "subscriptionID": "'"$subscriptionID"'", + "redisCacheName": "'"$redisName"'", + "gatewayPrivateIP": "'"$gatewayPrivateIP"'", + "offerType": "'"$offerType"'", + "azEnvironment": "'"$azEnvironment"'" +} +' + +destination=$WORKSPACE/controller/dynamicOptions.json +rm $destination + +echo $JSONCMD >> $destination + +echo "Written Config File successfully" + +cd $WORKSPACE/cloud/main +node $WORKSPACE/cloud/main/server/hash_pw.js "${userName}" "${passWord}" "${passWord}" + +echo "Written sudo passwd successfully" + +cp ./.shadow ./bin/. + +echo "Copied shadow file" + +# Update package lists and log errors +sudo apt-get update 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt update failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +# Install openssh-server and log errors +sudo apt-get install -y openssh-server 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt install failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +systemctl restart refarchcontroller + +echo "Restarted daemon successfully!" + + +# chown to this user /opt/mathworks +# Clear history +history -c + +echo "Cleared History!" +# File Location +#https://mwstorage24.blob.core.windows.net/azuretemplates/initVm.sh \ No newline at end of file diff --git a/releases/R2025a/scripts/scriptScaleSet.ps1 b/releases/R2025a/scripts/scriptScaleSet.ps1 new file mode 100644 index 0000000..13679b3 --- /dev/null +++ b/releases/R2025a/scripts/scriptScaleSet.ps1 @@ -0,0 +1,55 @@ +<# + .SYNOPSIS + This Script runs on MPS instances +#> + +# Param ( +# [Parameter(Mandatory=$False)][string]$SERVER_MODE +# ) + +# disable automatic updates +Echo "disabling automatic updates" +$service = Get-WmiObject Win32_Service -Filter 'Name="wuauserv"' +if ($service) +{ + if ($service.StartMode -ne "Disabled") + { + $result = $service.ChangeStartMode("Disabled").ReturnValue + if($result) + { + Echo "Failed to disable the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to disable the 'wuauserv' service."} + + if ($service.State -eq "Running") + { + $result = $service.StopService().ReturnValue + if ($result) + { + Echo "Failed to stop the 'wuauserv' service. The return value was $result." + } + else {Echo "Success to stop the 'wuauserv' service."} + } + } + else {Echo "The 'wuauserv' service is already disabled."} +} +else {Echo "Failed to retrieve the service 'wuauserv'."} + +#Disable Automatic Windows Updates +Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AUOptions -Value 1 + +# exclude .ctf file from windows defender scanning +#Add-MpPreference -ExclusionExtension ".ctf" + +#Get-ChildItem "C:\Program Files\MATLAB\MATLAB Runtime\" -Directory | +# ForEach-Object { +# Echo ($_.FullName + '\bin\win64\extractCTF.exe') +# Add-MpPreference -ExclusionProcess ($_.FullName + '\bin\win64\extractCTF.exe') +# } + +Stop-Service -Name Spooler -Force + +Set-Service -Name Spooler -StartupType Disabled + +# Execute reboot required for domain join +#Restart-Computer \ No newline at end of file diff --git a/releases/R2025a/scripts/scriptScaleSet.sh b/releases/R2025a/scripts/scriptScaleSet.sh new file mode 100644 index 0000000..6b4f442 --- /dev/null +++ b/releases/R2025a/scripts/scriptScaleSet.sh @@ -0,0 +1,23 @@ +#! /bin/bash +#Put your extra commands here +LOG_DIR=/var/log/custom_script +LOG_FILE=$LOG_DIR/custom_script.log + +# Create log directory and file +sudo mkdir -p $LOG_DIR +sudo touch $LOG_FILE +sudo chmod 666 $LOG_FILE + +# Update package lists and log errors +sudo apt-get update 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt update failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +# Install openssh-server and log errors +sudo apt-get install -y openssh-server 2>> $LOG_FILE +if [ $? -ne 0 ]; then + echo "apt install failed. Check the log file at $LOG_FILE" | tee -a $LOG_FILE +fi + +ls \ No newline at end of file