3.0 KiB
		
	
	
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			3.0 KiB
		
	
	
	
	
		
			Executable File
		
	
	
	
	
			
				#!/bin/sh
# {{ ansible_managed }}
 
# Pretty uptime
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
mins=$((${upSeconds}/60%60))
hours=$((${upSeconds}/3600%24))
days=$((${upSeconds}/86400))
UPTIME=`printf "%d jours, %02dh%02dm" "$days" "$hours" "$mins"`
 
# RAM
RAM=`free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'`
DISK=`df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}'`
 
# Text font
bold=$(tput bold)
normal=$(tput sgr0)
 
# Logo
cat << EOF
 
${bold}Uptime${normal} : ${UPTIME}
${bold}Mémoire${normal} : ${RAM}
${bold}Disque racine${normal} : ${DISK}
                                    
                                      
                                       
                                         
                                         
                                         
                                         
                                        
                                        
                                       
                                       
                                      
${bold}Aurore${normal}
 
EOF
		
	# {{ ansible_managed }}
# Pretty uptime
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
mins=$((${upSeconds}/60%60))
hours=$((${upSeconds}/3600%24))
days=$((${upSeconds}/86400))
UPTIME=`printf "%d jours, %02dh%02dm" "$days" "$hours" "$mins"`
# RAM
RAM=`free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'`
DISK=`df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}'`
# Text font
bold=$(tput bold)
normal=$(tput sgr0)
# Logo
cat << EOF
${bold}Uptime${normal} : ${UPTIME}
${bold}Mémoire${normal} : ${RAM}
${bold}Disque racine${normal} : ${DISK}
${bold}Aurore${normal}
EOF