rien / reStream

Stream your reMarkable screen over SSH.
MIT License
732 stars 56 forks source link

SSH_CONNECTION is not as expected #105

Open Rintse opened 2 months ago

Rintse commented 2 months ago

For some reason that I was not able to decipher after a quick search, there is extra information in the SHH connection related environment variables on the tablet:

root@reMarkable:~# env | grep SSH
SSH_CONNECTION=::ffff:10.11.99.2 46948 ::ffff:10.11.99.1 22
SSH_CLIENT=::ffff:10.11.99.2 46948 22
SSH_TTY=/dev/pts/1

While there is an easy (ugly) fix I used on my end:

root@reMarkable:~# echo $SSH_CONNECTION | cut -d" " -f3 | cut -d":" -f4
10.11.99.1
# still works with the old format
root@reMarkable:~# echo "10.11.99.1" | cut -d":" -f4
10.11.99.1

I don't like it enough to propose it as a solution.