This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JJ Asghar
committed
Jul 30, 2012
1 parent
7a1b5c6
commit 4561aac
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 " | ||
################################################################################# | ||
|
@@ -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 :++++++++++++++++++++++++++++++ | ||
|