# vim: ft=sh function nginx () { nc -zw2 127.0.0.1 80 || echo "injoignable sur port 80 local" nc -zw2 paris12.pcf.fr 80 || echo "injoignable sur port 80 distant" nc -zw2 paris12.pcf.fr 443 || echo "injoignable sur port 443 distant" } function core_temp () { local min=60 local level=("warning" "severe" "danger!") local step=$(( $( $((min + step * 10))°" fi } function core_alim () { eval $(/opt/vc/bin/vcgencmd measure_volts core) volt_fmt=${volt/\.} volt_fmt=${volt_fmt/V} test $volt_fmt -lt 12000 -o $volt_fmt -gt 15000 && echo "$volt" } function clean_swap () { _turn 2 || return if free -m | awk ' /^Swap:/ { used = $3 } END { exit (used > 31) } '; then echo 1 > /proc/sys/vm/drop_caches systemctl stop dphys-swapfile \ && systemctl stop zram \ && systemctl start zram \ && systemctl start dphys-swapfile \ || echo 'erreur' fi } function mem_pressure () { local meminfo=($(