Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
changed it to be more linuxie
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ Asghar committed Jul 30, 2012
1 parent 7a1b5c6 commit 4561aac
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions dynmotd
Original file line number Diff line number Diff line change
@@ -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="[email protected]"
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 "
#################################################################################
Expand All @@ -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 = [email protected]
+ admin = $EMAIL
+ date = $DATE
+ epoch = $EPOCH
+++++++++++++++++++++++++: Maintenance Information :++++++++++++++++++++++++++++++
Expand Down

0 comments on commit 4561aac

Please sign in to comment.