aboutsummaryrefslogtreecommitdiff
path: root/admin/pingmaint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-08-29 20:06:44 -0400
committerB. Watson <urchlay@slackware.uk>2026-08-29 20:06:44 -0400
commit55504fefce3078ac683b85508fa8af9e4d1b2059 (patch)
treee5590710b084f84520cfcce5f421403ea5a54132 /admin/pingmaint
parent8a78cfe513eb112585a5c5660fcbeb7cb3c58719 (diff)
downloadsbostuff-55504fefce3078ac683b85508fa8af9e4d1b2059.tar.gz
admin/*: added.
Diffstat (limited to 'admin/pingmaint')
-rwxr-xr-xadmin/pingmaint91
1 files changed, 91 insertions, 0 deletions
diff --git a/admin/pingmaint b/admin/pingmaint
new file mode 100755
index 0000000..76c6a34
--- /dev/null
+++ b/admin/pingmaint
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+FROM_NAME="B. Watson"
+FROM_EMAIL="urchlay@slackware.uk"
+
+# Usage:
+# pingmaint "Maintainer Name"
+# pingmaint maintainer@domain.tld
+
+SELF=$( basename $0 )
+
+die() {
+ echo "$SELF: $@" 1>&2
+ exit 1
+}
+
+source ~/sbostuff/sbostuff.sh
+cdsb
+
+interactive=yes
+if [ "$1" = "-m" ]; then
+ interactive=no
+ shift
+fi
+
+# given a maintainer's name as args, set TO_ADDR to the email address.
+# if there are more than one email address for the name, print them
+# all and die.
+get_email() {
+ TO_ADDR=""
+
+ TO_ADDR="$( git grep -lF "MAINTAINER=\"$*\"" '*/*/*.info' | xargs grep '^EMAIL=' | cut -d\" -f2 | sort -u | cut -d\" -f2 )"
+
+ if [ "$( echo "$TO_ADDR" | wc -l )" -gt 1 ]; then
+ if [ "$interactive" = "no" ]; then
+ die "Multiple email addresses: $TO_ADDR"
+ fi
+ echo "Multiple email addresses: $TO_ADDR"
+ echo "==> Which address to use?"
+ read TO_ADDR
+ fi
+}
+
+builds="$( getmaintbuilds "$@" )"
+
+if echo "$*" | grep -q '@'; then
+ TO_ADDR="$@"
+else
+ get_email "$@"
+fi
+
+if ! echo "$TO_ADDR" | grep -q '@'; then
+ if [ "$interactive" = "no" ]; then
+ die "Obfuscated address: $TO_ADDR"
+ else
+ echo "==> Enter unobfuscated version of: $TO_ADDR"
+ read TO_ADDR
+ fi
+fi
+
+tmpfile="$( mktemp $SELF.XXXXXXXXXX )"
+rm -f $tmpfile
+
+echo "To: $TO_ADDR"
+cat <<EOF >$tmpfile
+From: $FROM_NAME <$FROM_EMAIL>
+Subject: builds on SlackBuilds.org
+
+You're listed as maintainer for these builds:
+
+$builds
+
+It's been a while since your last update on SBo. Are you still
+maintaining these?
+
+Please let me know.
+EOF
+
+cat $tmpfile
+
+if [ "$interactive" = "yes" ]; then
+ echo
+ echo "===> Press Enter to send this email, ^C to abort."
+ read
+fi
+
+echo
+echo "==> Sending email to $TO_ADDR"
+cat $tmpfile | msmtp "$TO_ADDR"
+
+rm -f $tmpfile