Skip to content

Commit

Permalink
updated setup so it has an ssh checker
Browse files Browse the repository at this point in the history
  • Loading branch information
manx52 committed Oct 2, 2024
1 parent 3745f0e commit cc8e336
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions tools/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ check_internet_connection () {
fi
}

check_ssh_connection() {
if ssh -q [email protected]; [ $? -eq 255 ]; then
echo "SSH is not authenticated. Please setup ssh key"
exit 1
else
echo "SSH is successfully authenticated"
fi

}

ask_question() {
while true; do
read -p "$1 [Y/n]: " -n 1 -r response
Expand Down Expand Up @@ -109,6 +119,10 @@ setup_repo(){
catkin build soccerbot
echo "source /home/$USER/catkin_ws/devel/setup.bash" >> ~/.bashrc && source ~/.bashrc

# Fixing ros logging in pytests
mkdir -p /home/$USER/.ros/config && cd /home/$USER/.ros/config
ln -s /opt/ros/noetic/etc/ros/python_logging.conf

else
echo "Please install Repo manually!"
fi
Expand All @@ -125,6 +139,7 @@ if ask_question "Do you have sudo rights?"; then
has_sudo=1
sudo apt update
fi

if ask_question "Do you have a nvidia graphics card and want to install cuda?"; then
wants_cuda=1
fi
Expand Down Expand Up @@ -157,9 +172,7 @@ if ask_question "Install ROS?"; then
fi

if ask_question "Setup Repo?"; then
if ask_question "Is ssh key setup correctly?"; then # TODO Maybe do a check
check_ssh_connection
setup_repo
else
echo "Please install Repo manually!"
fi

fi

0 comments on commit cc8e336

Please sign in to comment.