No fallar si no hay ssh-agent

This commit is contained in:
f 2021-09-28 15:11:19 -03:00
parent 74a4985ea2
commit 62cb0883cc

View file

@ -49,6 +49,13 @@ correr() {
SET_GID="$(id -g)" SET_GID="$(id -g)"
fi fi
# Agregar flags dinámicas
EXTRA_FLAGS=""
if test -S "${SSH_AUTH_SOCK}"; then
EXTRA_FLAGS="${EXTRA_FLAGS} --bind ${SSH_AUTH_SOCK} ${SSH_AUTH_SOCK}"
fi
env -i \ env -i \
TERM="$TERM" \ TERM="$TERM" \
USER="suttier" \ USER="suttier" \
@ -72,12 +79,12 @@ correr() {
--ro-bind /etc/hosts /etc/hosts \ --ro-bind /etc/hosts /etc/hosts \
--ro-bind /etc/resolv.conf /etc/resolv.conf \ --ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/localtime /etc/localtime \ --ro-bind /etc/localtime /etc/localtime \
--bind "${SSH_AUTH_SOCK}" "${SSH_AUTH_SOCK}" \
--dev-bind /dev /dev \ --dev-bind /dev /dev \
--dev-bind /sys /sys \ --dev-bind /sys /sys \
--dev-bind /proc /proc \ --dev-bind /proc /proc \
--dev-bind /tmp /tmp \ --dev-bind /tmp /tmp \
--chdir "$WORKDIR" \ --chdir "$WORKDIR" \
${EXTRA_FLAGS} \
/bin/sh -l -c "$1" < "${stdin:-/dev/null}" /bin/sh -l -c "$1" < "${stdin:-/dev/null}"
} }