No fallar si no hay ssh-agent
This commit is contained in:
parent
74a4985ea2
commit
62cb0883cc
1 changed files with 8 additions and 1 deletions
9
haini.sh
9
haini.sh
|
@ -49,6 +49,13 @@ correr() {
|
|||
SET_GID="$(id -g)"
|
||||
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 \
|
||||
TERM="$TERM" \
|
||||
USER="suttier" \
|
||||
|
@ -72,12 +79,12 @@ correr() {
|
|||
--ro-bind /etc/hosts /etc/hosts \
|
||||
--ro-bind /etc/resolv.conf /etc/resolv.conf \
|
||||
--ro-bind /etc/localtime /etc/localtime \
|
||||
--bind "${SSH_AUTH_SOCK}" "${SSH_AUTH_SOCK}" \
|
||||
--dev-bind /dev /dev \
|
||||
--dev-bind /sys /sys \
|
||||
--dev-bind /proc /proc \
|
||||
--dev-bind /tmp /tmp \
|
||||
--chdir "$WORKDIR" \
|
||||
${EXTRA_FLAGS} \
|
||||
/bin/sh -l -c "$1" < "${stdin:-/dev/null}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue