38a20c881e
In order to be more crontab friendly, fluxplug will be the only executable called by cron in an every minute job, Something like * * * * * /path/to/fluxplug >/dev/null 2>&1 Signed-off-by: Nagy Károly Gábriel <k@jpi.io>
13 lines
343 B
Bash
13 lines
343 B
Bash
#!/bin/sh
|
|
|
|
set -o noclobber
|
|
|
|
me="packs"
|
|
|
|
LINE=$("$APT" | "$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1~/^Inst/) counter=counter+1} END {if (counter) printf "packages,host=%s packs=%si %s\n",myhost,counter,time}')
|
|
|
|
if [ -n "${LINE##+([[:space:]])}" ]; then # <= FIXME! find a better way.
|
|
writeline "$LINE" "$MAXLINES" "$me"
|
|
fi
|
|
|