21 lines
500 B
Bash
Executable file
21 lines
500 B
Bash
Executable file
#! /usr/bin/sh
|
|
|
|
WATCHLIST=~/.local/share/package-alert/watchlist
|
|
|
|
agg_results=""
|
|
|
|
if [ -f "${WATCHLIST}" ]; then
|
|
for pattern in $(cat "${WATCHLIST}"); do
|
|
pat_results=$(apt-cache search --names-only "${pattern}")
|
|
if [ ! -z "${pat_results}" ]; then
|
|
agg_results="${agg_results:+${agg_results}
|
|
}Packages matching \"${pattern}\":
|
|
${pat_results}
|
|
"
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if [ ! -z "${agg_results}" ]; then
|
|
printf '%s' "${agg_results}" | /usr/sbin/sendmail "${USER}"
|
|
fi
|