logger -s -t $LOGTAG "starting downloading files in $list"
while read -r url filename; do
- if wget --cut-dirs=100 -np -e robots=off -O $outdir$filename $otherargs $url; then
+ destarg = ''
+ if [ -n "$filename" ]; then
+ $destarg = " -O $outdir$filename"
+
+ if output=$(wget --cut-dirs=100 -np -e robots=off -P $outdir$destarg $otherargs $url); then
sed -i "/$filename/d" $list
echo $filename
logger -s -t $LOGTAG "downloaded $filename"
else
- logger -s -t $LOGTAG "downloading of $filename from $url failed."
+ logger -s -t $LOGTAG "downloading of $filename from $url failed: $output"
fi
done < $list
--- /dev/null
+#!/usr/bin/perl
+
+$REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!";
+
+@data = qx</usr/sbin/postqueue -p>;
+for (@data) {
+ if (/^(\w+)(\*|\!)?\s/) {
+ $queue_id = $1;
+ }
+ if($queue_id) {
+ if (/$REGEXP/i) {
+ $Q{$queue_id} = 1;
+ $queue_id = "";
+ }
+ }
+}
+
+#open(POSTSUPER,"|cat") || die "couldn't open postsuper" ;
+open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ;
+
+foreach (keys %Q) {
+ print POSTSUPER "$_\n";
+};
+close(POSTSUPER);
--- /dev/null
+# simple blacklist updater for OpenWRT
+
+#! /bin/sh
+set -e
+
+blacklist=https://v.firebog.net/hosts/Easylist.txt
+mkdir -p /tmp/dnsmasq-blocklist
+wget --cut-dirs=100 -np -nH -O /tmp/dnsmasq-blocklist/ads $blacklist
+sed -i -e 's/^/0.0.0.0 /' /tmp/dnsmasq-blocklist/ads
+/etc/init.d/dnsmasq restart