Initial commit

This commit is contained in:
waal70
2024-10-26 16:23:45 +02:00
commit b00d31c48d
22 changed files with 475 additions and 0 deletions

View 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

View 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

View 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; }'

View 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)"; }'

View 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"