From 9dcde426dc2a1d038b46d9e6db4889ffd6ed86b9 Mon Sep 17 00:00:00 2001 From: jwillmartin Date: Mon, 10 Jul 2023 11:08:53 -0400 Subject: [PATCH 1/2] modified: initialization.sh --- configuration/amd64/initialization.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/amd64/initialization.sh b/configuration/amd64/initialization.sh index 03660e9d5..81bf785cc 100755 --- a/configuration/amd64/initialization.sh +++ b/configuration/amd64/initialization.sh @@ -41,5 +41,5 @@ sudo docker-compose up -d cd mysql ./add_v2xhub_user.bash -chromium-browser "https://127.0.0.1" > /dev/null 2>&1 & +chromium-browser "http://127.0.0.1" > /dev/null 2>&1 & chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 & From 3c7d1cd092ea43b596059e438f4aeb61172727c1 Mon Sep 17 00:00:00 2001 From: jwillmartin Date: Mon, 10 Jul 2023 11:49:15 -0400 Subject: [PATCH 2/2] modified: configuration/amd64/initialization.sh modified: configuration/arm64/initialization.sh --- configuration/amd64/initialization.sh | 36 ++++++++++++++++--------- configuration/arm64/initialization.sh | 39 ++++++++++++++++++--------- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/configuration/amd64/initialization.sh b/configuration/amd64/initialization.sh index 81bf785cc..eea35fc48 100755 --- a/configuration/amd64/initialization.sh +++ b/configuration/amd64/initialization.sh @@ -1,4 +1,6 @@ #!/bin/bash +directory=$(pwd) +mysqlDir="$directory/mysql" # update and upgrade commands to update linux OS sudo apt update -y && sudo apt upgrade -y @@ -11,21 +13,31 @@ sudo apt install curl -y #Curl for downloading files over i curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash #make passwords for mysql -mkdir secrets && cd secrets +mkdir -p secrets && cd secrets #creates password files where user inputs password -read -p "enter password for the mysql_root_password: " sql_root_pass -echo "$sql_root_pass" > sql_root_pass.txt - -read -p "enter password for mysql_password: " sql_pass -echo "$sql_pass" > sql_pass.txt - -#remove endline characters from password files -tr -d '\n' mysql_root_password.txt && tr -d '\n' mysql_password.txt -rm sql_root_pass.txt && rm sql_pass.txt +FILE1=mysql_root_password.txt +FILE2=mysql_password.txt +if test -f "$FILE1"; then + echo "$FILE1 exists." +else + read -p "enter password for the mysql_root_password: " sql_root_pass + echo "$sql_root_pass" > sql_root_pass.txt + #remove endline characters from password files + tr -d '\n' mysql_root_password.txt && rm sql_root_pass.txt +fi + +if test -f "$FILE2"; then + echo "$FILE2 exists." +else + read -p "enter password for mysql_password: " sql_pass + echo "$sql_pass" > sql_pass.txt + #remove endline characters from password files + tr -d '\n' mysql_password.txt && rm sql_pass.txt +fi #AMD64 initialzation -cd .. +cd $directory sudo apt-get -y remove docker docker-engine docker.io containerd runc sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - @@ -38,7 +50,7 @@ sudo apt update -y && sudo apt upgrade -y sudo docker-compose up -d #create v2xhub user -cd mysql +cd $mysqlDir ./add_v2xhub_user.bash chromium-browser "http://127.0.0.1" > /dev/null 2>&1 & diff --git a/configuration/arm64/initialization.sh b/configuration/arm64/initialization.sh index 2430a1641..7769004df 100755 --- a/configuration/arm64/initialization.sh +++ b/configuration/arm64/initialization.sh @@ -1,4 +1,7 @@ #!/bin/bash +directory=$(pwd) +mysqlDir="$directory/mysql" + # update and upgrade commands to update linux OS sudo apt update -y && sudo apt upgrade -y @@ -10,21 +13,31 @@ sudo apt install curl -y #Curl for downloading files over i curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash #make passwords for mysql -mkdir secrets && cd secrets +mkdir -p secrets && cd secrets #creates password files where user inputs password -read -p "enter password for the mysql_root_password: " sql_root_pass -echo "$sql_root_pass" > sql_root_pass.txt - -read -p "enter password for mysql_password: " sql_pass -echo "$sql_pass" > sql_pass.txt - -#remove endline characters from password files -tr -d '\n' mysql_root_password.txt && tr -d '\n' mysql_password.txt -rm sql_root_pass.txt && rm sql_pass.txt +FILE1=mysql_root_password.txt +FILE2=mysql_password.txt +if test -f "$FILE1"; then + echo "$FILE1 exists." +else + read -p "enter password for the mysql_root_password: " sql_root_pass + echo "$sql_root_pass" > sql_root_pass.txt + #remove endline characters from password files + tr -d '\n' mysql_root_password.txt && rm sql_root_pass.txt +fi + +if test -f "$FILE2"; then + echo "$FILE2 exists." +else + read -p "enter password for mysql_password: " sql_pass + echo "$sql_pass" > sql_pass.txt + #remove endline characters from password files + tr -d '\n' mysql_password.txt && rm sql_pass.txt +fi #ARM initialization -cd .. +cd $directory sudo apt-get -y remove docker docker-engine docker.io containerd runc sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common OS=$(lsb_release -i | awk 'FS=":" {print $3;}' | awk '{print tolower($0)}') @@ -38,8 +51,8 @@ sudo apt update -y && sudo apt upgrade -y sudo docker-compose up -d #create v2xhub user -cd mysql +cd $mysqlDir ./add_v2xhub_user.bash -chromium-browser "https://127.0.0.1" > /dev/null 2>&1 & +chromium-browser "http://127.0.0.1" > /dev/null 2>&1 & chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &