Created
November 9, 2014 01:39
-
-
Save anonymous/9f0e1a763385b549d008 to your computer and use it in GitHub Desktop.
/etc/profile.d/50-landscape-sysinfo.sh - Update to turn of for certain users.
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
#!/bin/sh | |
cores=$(grep -c ^processor /proc/cpuinfo 2>/dev/null) | |
[ "$cores" -eq "0" ] && cores=1 | |
threshold="${cores:-1}.0" | |
if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < $threshold" | bc) -eq 1 ]; then | |
if [ ! -f ~/.no_stats ]; then | |
echo | |
echo -n " System information as of " | |
/bin/date | |
echo | |
/usr/bin/landscape-sysinfo | |
fi | |
else | |
echo | |
echo " System information disabled due to load higher than $threshold" | |
fi | |
#added line 5 and line 12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment