X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=61f4266415a94d2ee13d1a46df7956d9b9a2db2b;hp=02158374784e0f71a7f06f09cc545b80159b1f4d;hb=df29c9febe86bbc6bfcd8fd20da28b7bad86307e;hpb=fadf5ac146886c9d652eac3ac8f1c70d4407d572 diff --git a/autoconfig.functions b/autoconfig.functions index 0215837..61f4266 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1346,6 +1346,34 @@ config_netscript() { } # }}} +# {{{ stats +config_stats() { + if ! checkbootparam 'nostats' ; then + BASE_URL="http://stats.grml.org/report/" + ACTION_NAME=Boot + + HOST_ID=$(cat /proc/sys/kernel/random/boot_id) + + grep -q " lm " /proc/cpuinfo && HAS_64BIT="1" || HAS_64BIT="0" + DATE_STRING=$(date +'h=%H&m=%M&s=%S') + [ -e /etc/grml_version ] && VERSION=$(cat /etc/grml_version) || \ + VERSION=$(lsb_release -d | awk -F: '{gsub(/^[ \t]+/, "", $2); print $2}') + + PARAMS="$( echo "$CMDLINE" | sed -e 's/=[^ ]*/=VALUE/g' | tr " " "\n"|sort|tr "\n" " " )" + + echo "$CMDLINE" | grep -q -e "fetch|nfsroot" && BOOT="remote" + [ -z "$BOOT" ] && BOOT="local" + + ADDITIONAL_PARAMS="" + ( [ -n "$COLUMNS" ] && [ -n "$LINES" ] ) && \ + ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS&res=$((COLUMNS * 8))x$((LINES * 16))" + + URI='$BASE_URL?action=${ACTION_NAME}\&$DATE_STRING\&unique_id=${HOST_ID}\&support_64bit=$HAS_64BIT\&version=$version\&bootup=$BOOT\¶ms=$PARAMS$ADDITIONAL_PARAMS' + + get_remote_file "$URI" "/dev/null" >/dev/null 2>&1 &! + fi +} +# }}} # {{{ fix/workaround for unionfs fix_unionfs(){ if [ -z "$INSTALLED" ]; then