Skip to content

Commit

Permalink
Update agent-installer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
pastudan authored Nov 15, 2021
1 parent 1c29e36 commit dcbac29
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions agent-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,37 @@ EOF

chmod +x /opt/kubesail/init.sh

cat <<'EOF' > /usr/local/bin/kubesail
#!/bin/bash
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root. Try re-running with sudo, e.g. $(tput bold)sudo kubesail init$(tput sgr0)"
exit
fi
read -p "What is your KubeSail username? " KUBESAIL_USERNAME
if [ -z "$KUBESAIL_USERNAME" ]; then
echo "Username is empty, not installing KubeSail."
exit 1
fi
read -p "Do you want to install $(tput bold)${KUBESAIL_USERNAME}$(tput sgr0)'s public GitHub $KUBESAIL_USERNAME for SSH access? [Y/n] " GITHUB_SSH
GITHUB_SSH=${GITHUB_SSH:-Y}
echo $KUBESAIL_USERNAME > /boot/kubesail-username.txt
if [ $GITHUB_SSH = "Y" ]; then
echo $KUBESAIL_USERNAME > /boot/github-ssh-username.txt
fi
echo "Installing KubeSail agent. Please wait..."
sudo service kubesail-init start
EOF
chmod +x /usr/local/bin/kubesail


# Install service
cat <<'EOF' > /etc/systemd/system/kubesail-init.service
[Unit]
Expand Down

0 comments on commit dcbac29

Please sign in to comment.