From d3a0fc2aef55a41180451d48e2b4f5007911c269 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 31 Aug 2021 18:05:55 -0300 Subject: [PATCH] Mandar mensajes a stderr Para que no entren en el "eval" de init --- haini.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/haini.sh b/haini.sh index eed587f..477417c 100755 --- a/haini.sh +++ b/haini.sh @@ -11,18 +11,18 @@ SELF="$(basename "$0")" # Sólo se puede correr desde el directorio de Sutty if test "$ROOT" != "$(dirname "$PWD")" && test "$ROOT" != "$PWD"; then - echo "¡No estás corriendo dentro de una carpeta de Sutty!" + echo "¡No estás corriendo dentro de una carpeta de Sutty!" >&2 fi # Necesitamos bubblewrap if ! test "$HAIN_ENV" && ! type bwrap >/dev/null 2>&1 ; then - echo "Por favor, instala el paquete bubblewrap" + echo "Por favor, instala el paquete bubblewrap" >&2 exit 1 fi if test $(sysctl -n kernel.unprivileged_userns_clone) -ne 1 ; then echo "Necesitamos configurar tu sistema, ingresa tu contraseña para correr el comando" >&2 - echo "sudo sysctl -a kernel.unprivileged_userns_clone=1" + echo "sudo sysctl -a kernel.unprivileged_userns_clone=1" >&2 sudo sysctl -a kernel.unprivileged_userns_clone=1 fi @@ -38,7 +38,7 @@ fi ENTORNO=${ENTORNO:-${ROOT}/hain} correr() { - echo "> $1" + echo "> $1" >&2 env -i \ TERM="$TERM" \ @@ -83,7 +83,7 @@ generar_certificado() { if test -f "$ROOT/sutty.local/domain/sutty.local.crt"; then SUTTY_LOCAL="$ROOT/sutty.local" - echo "Migrando certificados de sutty.local..." + echo "Migrando certificados de sutty.local..." >&2 cp "$SUTTY_LOCAL/ca/key.key" "$ENTORNO$ca_key" cp "$SUTTY_LOCAL/ca/crt.crt" "$ENTORNO$ca_crt" @@ -94,7 +94,7 @@ generar_certificado() { return fi - echo "Generando certificados..." + echo "Generando certificados..." >&2 correr "openssl req -x509 -nodes -new -sha256 -days 3650 -newkey rsa:2048 \ -keyout $ca_key -out $ca_crt.pem -subj '/C=AR/CN=Sutty-Local-CA'" @@ -111,7 +111,7 @@ generar_certificado() { rm "$ENTORNO$ca_crt.pem" - echo "Instalando certificados..." + echo "Instalando certificados..." >&2 if which update-ca-certificates 2>/dev/null; then sudo install -Dm 644 "$ENTORNO$ca_crt" /usr/share/ca-certificates/extra/sutty.crt sudo dpkg-reconfigure ca-certificates @@ -147,7 +147,7 @@ crear_entorno() { # Instalar las dependencias solo si cambiaron if test "$ENTORNO/etc/apk/world" -ot "$DIR/packages"; then - echo "Instalando paquetes..." + echo "Instalando paquetes..." >&2 packages="$(cat "$DIR/packages" | tr "\n" " ")" correr "apk add --no-cache $packages" fi