From 4561aac9de5b4937b7ef5e432077387d4161ebd0 Mon Sep 17 00:00:00 2001 From: JJ Asghar Date: Mon, 30 Jul 2012 14:14:05 -0500 Subject: [PATCH] changed it to be more linuxie --- dynmotd | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/dynmotd b/dynmotd index 7fac669..7c7fa0d 100755 --- a/dynmotd +++ b/dynmotd @@ -1,10 +1,22 @@ -#!/usr/local/bin/bash +#!/bin/bash + +# +# Add this to /etc/profile +# example: +# /usr/local/bin/dynmotd +# Don't forget to chmod +x it. +# Create /etc/motd-maint to track changes that need to be posted +# + + +EMAIL="jjasghar@gmail.com" PROCCOUNT=`ps -Afl | wc -l` PROCCOUNT=`expr $PROCCOUNT - 5` -NIC=em0 -IPADDY=`ifconfig $NIC | grep inet | awk -F " " '{print $2}' | grep -v ::` +NIC=eth0 +IPADDY=`ifconfig $NIC | grep inet | awk -F " " '{print $2}' | grep -v :: | sed 's/addr://g'` DATE=`date +%F` EPOCH=`date +%s` +UPTIME=`uptime` # | sed 's/.*up ([^,]*), .*/1/'` echo -e " ################################################################################# @@ -21,12 +33,12 @@ echo -e " + address = $IPADDY + os type = `uname -s` + kernel = `uname -r` -+ uptime = `uptime | sed 's/.*up ([^,]*), .*/1/'` ++ uptime = $UPTIME ++++++++++++++++++++++++++++++++: User Data :+++++++++++++++++++++++++++++++++++++ + username = `whoami` + processes = $PROCCOUNT of `ulimit -u` +++++++++++++++++++++++++++: Helpful Information :++++++++++++++++++++++++++++++++ -+ admin = jjasghar@utexas.edu ++ admin = $EMAIL + date = $DATE + epoch = $EPOCH +++++++++++++++++++++++++: Maintenance Information :++++++++++++++++++++++++++++++