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

View File

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