[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Scriptable motd for initial SSH login?
- Subject: [ale] Scriptable motd for initial SSH login?
- From: james.sumners at gmail.com (James Sumners)
- Date: Wed, 14 Sep 2011 18:41:08 -0400
- In-reply-to: <[email protected]>
- References: <CAAt=rgCH8iywEL2+52NLhDj4gvraZQbGmHJPJv-Zhu82r5RLaw@mail.gmail.com> <[email protected]> <1316026962.574.28.camel@compaq-desktop> <CAAt=rgAcagy+yLoFpFvw6Q-xLQ5B=3Zmc4uCqy8S9iDv+rbo+Q@mail.gmail.com> <[email protected]>
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