add munsubscribe script

This commit is contained in:
Felix Van der Jeugt 2021-08-23 09:54:41 +02:00
parent 26372f06a0
commit 95287881c3
No known key found for this signature in database
GPG Key ID: 58B209295023754D
1 changed files with 2 additions and 3 deletions

View File

@ -1,9 +1,8 @@
#!/bin/sh
if [ -z "$*" ]; then
exec munsubscribe .
else
for url in $(mshow -qh list-unsubscribe "$@" | grep -o '<http[^>]*>' | sed -e 's/^<//' -e 's/>$//'); do
curl -w '%{http_code}' -s -o /dev/null "$url"
for url in $(mshow -qh list-unsubscribe "$@" | xurls -m http); do
curl -L -w '%{http_code}' -s -o /dev/null "$url"
done
fi