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)"
|
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}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue