Comment 5 for bug 1893716

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The net is full of suggestions e.g. https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch
With that:
  [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive' >> /tmp/update-motd-test
  shopt -q login_shell && echo 'Login shell' || echo 'Not login shell' >> /tmp/update-motd-test
In a test like:
  ssh testuser1@10.253.194.246 "ls ~/"
It will detect:
  Not interactive
  Not login shell

If not in libpam we could clearly use this in the script snippets to fast-pass most of them.
Sadly above checks seem trivial I've found that they always report non-interactive/non-login even when being such. It seems the way this is executed prevents proper detection.