[ale] Scriptable motd for initial SSH login?

James Sumners james.sumners at gmail.com
Wed Sep 14 18:41:08 EDT 2011


Okay then:

#!/bin/bash

if [ ! -t 1 ]; then
  # This is probably scp or sftp or something else
  exit
fi

# Use stderr for output like a good little boy
exec 1>&2

echo "Yay!"

On Wed, Sep 14, 2011 at 17:08, Michael H. Warfield <mhw at wittsend.com> wrote:
> Not quite sure why, especially since a normal motd is delivered on
> stderr.
>
> cat users_motd 1>2&
>
> Not that big of a deal is it?
>
> Add the checks that have been suggested to make sure you're connected to
> a ptty and not some pipe and you should be good.
>
> Mike



-- 
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts
pathological personalities. It is not that power corrupts but that it
is magnetic to the corruptible. Such people have a tendency to become
drunk on violence, a condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59


More information about the Ale mailing list