Skip to content

Instantly share code, notes, and snippets.

@pysysops
Last active September 25, 2017 09:50
Show Gist options
  • Save pysysops/d813a3f86149c63456fded6e667fac42 to your computer and use it in GitHub Desktop.
Save pysysops/d813a3f86149c63456fded6e667fac42 to your computer and use it in GitHub Desktop.
Script to add to /etc/profile.d to show alerts only when logging in via SSH
#!/usr/bin/env bash
# This script calls a python script to output
# current alerts on the current system when SSH'd
# in.
if [ "$SSH_TTY" ]
then
python /etc/profile.d/show_alerts.py
fi
@pysysops
Copy link
Author

A handy script to run at login. See: https://gist.github.com/pysysops/a39809f8da4a1c605ab31d834a00d1cf
Gives output below MOTD:
show_alerts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment