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
/
Copy pathdynmotd
executable file
·47 lines (42 loc) · 1.54 KB
/
dynmotd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/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=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 "
#################################################################################
WARNING:- YOU MUST HAVE PRIOR AUTHORIZATION TO ACCESS THIS SYSTEM. ALL
CONNECTIONS ARE LOGGED AND MONITORED. BY CONNECTING TO THIS SYSTEM YOU FULLY
CONSENT TO ALL MONITORING. UN-AUTHORIZED ACCESS OR USE WILL BE PROSECUTED TO
THE FULL EXTENT OF LAW. YOU HAVE BEEN WARNED
#################################################################################
"
echo -e "
+++++++++++++++++++++++++++++++++: System Data :++++++++++++++++++++++++++++++++++
+ hostname = `hostname`
+ address = $IPADDY
+ os type = `uname -s`
+ kernel = `uname -r`
+ uptime = $UPTIME
++++++++++++++++++++++++++++++++: User Data :+++++++++++++++++++++++++++++++++++++
+ username = `whoami`
+ processes = $PROCCOUNT of `ulimit -u`
+++++++++++++++++++++++++++: Helpful Information :++++++++++++++++++++++++++++++++
+ admin = $EMAIL
+ date = $DATE
+ epoch = $EPOCH
+++++++++++++++++++++++++: Maintenance Information :++++++++++++++++++++++++++++++
+ `cat /etc/motd-maint`
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"