Initial commit
This commit is contained in:
17
templates/etc/update-motd.d/11-welcome
Executable file
17
templates/etc/update-motd.d/11-welcome
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################
|
||||
# Script : 11-welcome
|
||||
# Author : Petr Všetečka, Andre
|
||||
# Email : vsetecka@cesnet.cz
|
||||
# Date : 27/11/2018, 16/07/2024
|
||||
# Description: prints distro name and kernel version
|
||||
# Args : none
|
||||
###############################################################
|
||||
|
||||
clear
|
||||
|
||||
printf "\nSystem managed by Ansible"
|
||||
|
||||
printf "\nWelcome to "; lsb_release -ds
|
||||
printf " System: "; uname -snrvm
|
||||
13
templates/etc/update-motd.d/13-uptime
Executable file
13
templates/etc/update-motd.d/13-uptime
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################
|
||||
# Script : 13-uptime
|
||||
# Author : Petr Všetečka
|
||||
# Email : vsetecka@cesnet.cz
|
||||
# Date : 27/11/2018
|
||||
# Description: prints total uptime in nice format
|
||||
# Args : none
|
||||
###############################################################
|
||||
|
||||
|
||||
printf "System is "; uptime -p
|
||||
31
templates/etc/update-motd.d/15-hwstats
Executable file
31
templates/etc/update-motd.d/15-hwstats
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################
|
||||
# Script : 15-hwstats
|
||||
# Author : Petr Všetečka
|
||||
# Email : vsetecka@cesnet.cz
|
||||
# Date : 27/11/2018
|
||||
# Description: prints current time and usage of CPU, RAM & HDD
|
||||
# Args : none
|
||||
###############################################################
|
||||
|
||||
|
||||
printf "\nSystem information as of "; date
|
||||
printf "\n"
|
||||
|
||||
# CPU
|
||||
printf " CPU load: "; cat /proc/loadavg | awk '{ printf "%s %s %s", $1, $2, $3; }'
|
||||
printf " ("
|
||||
printf $(($(ps -e --no-headers | wc -l) - 1))
|
||||
printf " processes)\n"
|
||||
# RAM
|
||||
free -m | awk '/Mem/ { printf " Memory: %4sM (%2d%%) out of %2.1fG\n", $3, ($3/$2) * 100, $2/1000; }
|
||||
/Swap/ {
|
||||
if ( $3 == 0 )
|
||||
printf " Swap: not available\n";
|
||||
else
|
||||
printf " Swap: %4sM (%2d%%) out of %2.1fG\n", $3, ($3/$2) * 100, $2/1000;
|
||||
|
||||
}'
|
||||
# Disk
|
||||
df -h | awk '/^\// { printf " Disk: %5s (%3s) out of %4s\n", $3, $5, $2; }'
|
||||
18
templates/etc/update-motd.d/17-users
Executable file
18
templates/etc/update-motd.d/17-users
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################
|
||||
# Script : 17-users
|
||||
# Author : Petr Všetečka
|
||||
# Email : vsetecka@cesnet.cz
|
||||
# Date : 27/11/2018
|
||||
# Description: prints names of all users currently logged in
|
||||
# Args : none
|
||||
###############################################################
|
||||
|
||||
|
||||
printf "\n"
|
||||
w -h | awk 'BEGIN { printf "Users logged in:"; }
|
||||
{ printf " %s", $1; }'
|
||||
top -bn1 | awk 'BEGIN { FS=", "; }
|
||||
$2~/user/ { print " (" $2 " total)"; }
|
||||
$3~/user/ { print " (" $3 " total)"; }'
|
||||
19
templates/etc/update-motd.d/19-ipaddresses
Normal file
19
templates/etc/update-motd.d/19-ipaddresses
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################
|
||||
# Script : 19-ipaddresses
|
||||
# Author : Andre
|
||||
# Date : 16/07/2024
|
||||
# Description: displays ipv4 and ipv6 addresses
|
||||
# Args : none
|
||||
###############################################################
|
||||
|
||||
printf "\n"
|
||||
|
||||
printf "IPv4 addresses\n"
|
||||
printf "===============================================================================\n"
|
||||
ip -h -br -f inet a
|
||||
printf "===============================================================================\n"
|
||||
printf "IPv6 addresses\n"
|
||||
ip -h -br -f inet6 a
|
||||
printf "===============================================================================\n"
|
||||
Reference in New Issue
Block a user