diff --git a/cbot.sh b/cbot.sh index f9b553c7..05344b43 100755 --- a/cbot.sh +++ b/cbot.sh @@ -523,14 +523,13 @@ EOF --name $CONTAINERNAME $IMAGE_SPEC else RANDOM_TOKEN="$(openssl rand -hex 21)" - if [ "$SSH_KEY_PATH" ] - then - CONTAINER_COMMAND=ssh-agent - elif [ "$FORWARD_SSH" ] + if [ "$FORWARD_SSH" ] then EXTERNAL_UID=$(id -u) EXTERNAL_GID=$(id -g) SSH_FORWARDING="-u $EXTERNAL_UID:$EXTERNAL_GID -v $(readlink -f $SSH_AUTH_SOCK):/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent" + else + CONTAINER_COMMAND=ssh-agent fi docker run -d $SSH_FORWARDING \ diff --git a/resources/containers/assets/dev-init b/resources/containers/assets/dev-init index 14ecb40b..353d463c 100644 --- a/resources/containers/assets/dev-init +++ b/resources/containers/assets/dev-init @@ -23,7 +23,7 @@ check-clone-robot(){ } check-load-botkey(){ ssh-add -l > /dev/null && return - ENCRYPTED_KEY=$(grep -A3 '"manage_key"' custom/conf/robot.yaml | sed -n 's/.*decrypt "\(.*\)" }}.*/\1/p') + ENCRYPTED_KEY=$(grep -A3 '"manage_key"' ~/custom/conf/robot.yaml | sed -n 's/.*decrypt "\(.*\)" }}.*/\1/p') echo "Loading robot's manage_key with encrypted passphrase ($ENCRYPTED_KEY)..." NAMED_PIPE=$(mktemp -u) mkfifo $NAMED_PIPE