Skip to content

Commit

Permalink
Handle pocs clone
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Nov 19, 2024
1 parent 9f2d661 commit 27f8db4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
13 changes: 6 additions & 7 deletions resources/scripts/install-pocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ PANDIR="${PANDIR:-${HOME}/POCS}"
# Check if PANDIR exists and if not, clone.
if [ -d "${PANDIR}" ]; then
echo "POCS repo already exists."
return
else
echo "Cloning POCS repo."
git clone https://github.com/panoptes/POCS "${PANDIR}"
cd "${PANDIR}"
git checkout "${CODE_BRANCH}"
cd
fi

echo "Cloning POCS repo."
git clone https://github.com/panoptes/POCS "${PANDIR}"
cd "${PANDIR}"
git checkout "${CODE_BRANCH}"
cd

echo "Creating POCS directories."
mkdir -p "${HOME}/logs"
mkdir -p "${HOME}/images"
Expand Down
18 changes: 7 additions & 11 deletions resources/scripts/setup-user.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env bash

function setup_user() {
# Set up passwordless sudo for all sudo group.
echo "%sudo ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/panoptes
# Set up passwordless sudo for all sudo group.
echo "%sudo ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/panoptes

# Add an SSH key if one doesn't exist.
if [[ ! -f "${HOME}/.ssh/id_rsa" ]]; then
echo "Adding ssh key"
ssh-keygen -t rsa -N "" -f "${HOME}/.ssh/id_rsa"
fi
}

setup_user
# Add an SSH key if one doesn't exist.
if [[ ! -f "${HOME}/.ssh/id_rsa" ]]; then
echo "Adding ssh key"
ssh-keygen -t rsa -N "" -f "${HOME}/.ssh/id_rsa"
fi

0 comments on commit 27f8db4

Please sign in to comment.