X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=roles%2Ftools%2Ffiles%2Fssh%2Frc;h=32d1bd465e85df2a286768770a82159d062ecb43;hb=d4357f69e1ccbb1c277f8978ea6f4a368b3ee3c2;hp=35b7d342e713230b7124a0e119c27d54022c44e2;hpb=34d5d6fc77fd440963b1e0cfc099bc7291c5eeb0;p=perso%2FImmae%2FConfig%2FAnsible.git diff --git a/roles/tools/files/ssh/rc b/roles/tools/files/ssh/rc index 35b7d34..32d1bd4 100644 --- a/roles/tools/files/ssh/rc +++ b/roles/tools/files/ssh/rc @@ -1,8 +1,9 @@ #!/bin/bash -if [ -n "$DISPLAY" ]; then - export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" - read protocol cookie - xauth remove $DISPLAY - xauth add $DISPLAY "$protocol" "$cookie" +if read proto cookie && [ -n "$DISPLAY" ]; then + if [ `echo $DISPLAY | cut -c1-10` = "localhost:" ]; then + echo add unix:`echo $DISPLAY | cut -c11-` $proto $cookie + else + echo add $DISPLAY "$protocol" "$cookie" + fi | xauth -q - fi