Browse Source

fluxplug: actually make packs plugin usable

Signed-off-by: Nagy Károly Gábriel <k@jpi.io>
master
Nagy Károly Gábriel 6 years ago
parent
commit
dcac1180a3
Signed by: karasz
GPG Key ID: C6BA1070A8CBDA0C
  1. 14
      plugins-available/packs

14
plugins-available/packs

@ -1,12 +1,18 @@
#!/bin/sh
# security upgrades
# /usr/bin/apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | /bin/grep -i securi | /usr/bin/cut -d\ -f2 | /bin/wc -w
# all upgrades
# /usr/bin/apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | /usr/bin/cut -d\ -f2 | /bin/wc -w
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}')
uppaks=$(/usr/bin/apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | /usr/bin/cut -d\ -f2 | /usr/bin/wc -w )
secpaks=$(/usr/bin/apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | /bin/grep -i securi | /usr/bin/cut -d\ -f2 | /usr/bin/wc -w )
if [ -n "${LINE##+([[:space:]])}" ]; then # <= FIXME! find a better way.
writeline "$LINE" "$MAXLINES" "$me"
fi
LINE="packages,host="$myhost" packs="$uppaks"i, security="$secpaks"i "$(/bin/date -u +%s%N)$'\n'
writeline "$LINE" "$MAXLINES" "$me"

Loading…
Cancel
Save