Skip to content

Instantly share code, notes, and snippets.

View samrocketman's full-sized avatar

Sam Gleske samrocketman

View GitHub Profile
@samrocketman
samrocketman / show-ip-before-login.sh
Last active March 28, 2016 12:55 — forked from rm/show-ip-before-login.sh
Show IP address on prelogin message
#!/bin/bash
# based on http://offbytwo.com/2008/05/09/show-ip-address-of-vm-as-console-pre-login-message.html
# based on https://gist.github.com/rm/3780228
# A better IP address method https://www.linuxquestions.org/questions/blog/sag47-492023/using-a-script-to-get-your-ip-address-35251/
# need to be root to write out these files
if [ "$(id -u)" != "0" ]; then
echo "Need to run as root. Maybe use sudo..."
exit
fi
#!/bin/sh
# based on http://offbytwo.com/2008/05/09/show-ip-address-of-vm-as-console-pre-login-message.html
# need to be root to write out these files
if [ `id -u` != 0 ]; then
echo "Need to run as root. Maybe use sudo..."
exit
fi
GET_IP_ADDRESS='/usr/local/bin/get-ip-address'