updates_void: corrección y simplificación de código
This commit is contained in:
parent
1a95b3a24b
commit
adff25920d
1 changed files with 15 additions and 14 deletions
|
@ -1,24 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
/usr/bin/xbps-install.static -nuM 1>/tmp/updates 2>/tmp/error
|
||||
TMP_UPDATES=/tmp/updates_void
|
||||
[ -d "${TMP_UPDATES}" ] || mkdir "${TMP_UPDATES}"
|
||||
|
||||
updates="$(wc -l < /tmp/updates)"
|
||||
broken="$(grep -c broken /tmp/error)"
|
||||
pkg="$(awk '{print $1" ---> "$2}' /tmp/updates)"
|
||||
pkgs="$(awk '{print $1}' /tmp/updates)"
|
||||
xx=$(printf "==============================")
|
||||
#/usr/bin/xbps-install.static -nuM 1>/tmp/updates 2>/tmp/error
|
||||
xbps-install -nuM 1>"${TMP_UPDATES}"/updates 2>"${TMP_UPDATES}"/error
|
||||
|
||||
updates="$(wc -l < "${TMP_UPDATES}"/updates)"
|
||||
broken="$(grep -c broken "${TMP_UPDATES}"/error)"
|
||||
pkgs="$(awk '{print $1" ---> " $2}' "${TMP_UPDATES}"/updates)"
|
||||
xx=$(printf "========================================")
|
||||
|
||||
if [ "$broken" = 0 ] && [ "$updates" -ge 1 ]; then
|
||||
"$HOME"/Dropbox/Gitea/scripts/varios/dunst_sound
|
||||
if [ "$updates" -eq 1 ]; then
|
||||
herbe "ACTUALIZACIÓN DISPONIBLE:" "$xx $pkg"
|
||||
elif [ "$updates" -gt 1 ]; then
|
||||
herbe "ACTUALIZACIONES DISPONIBLES: $updates" "$xx $pkgs"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
herbe "ACTUALIZACIONES DISPONIBLES: $updates" "$xx" "$pkgs"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "$broken" -ge 1 ]; then
|
||||
herbe "HAY PAQUETES ROTOS:" "$xx" "$(cut -d " " -f 1,5 /tmp/error)"
|
||||
herbe "HAY PAQUETES ROTOS:" "$xx" "$(cut -d " " -f 1,5 "${TMP_UPDATES}"/error)"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue