dootfiles/.config/yadm/bootstrap.d/ssh-manager

19 lines
655 B
Bash
Executable file

#!/bin/sh
if [ -z "$SUDO_USER" ] && [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
echo "+ Installing ssh-manager"
os=`uname -o`
if [ "$os" == "Darwin" ]; then
curl -fL https://github.com/omegion/ssh-manager/releases/latest/download/ssh-manager-darwin-amd64 -o "$HOME/bin/ssh-manager"
else
curl -fL https://github.com/omegion/ssh-manager/releases/latest/download/ssh-manager-linux-amd64 -o "$HOME/bin/ssh-manager"
fi
chmod a+x "$HOME/bin/ssh-manager"
else
if [ -n "$SUDO_USER" ]; then
echo "Skipping ssh-manager installation due to SUDO usage."
else
echo "Skipping ssh-manager installation due to remote login."
fi
fi