aboutsummaryrefslogtreecommitdiff
path: root/bin/gms
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-04-05 20:06:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-04-05 20:46:47 +1200
commitc8ab406749124d2e762ad5cf53963070113afd0f (patch)
tree54c9721a06957ebe7098a211eea803b0230c0f5d /bin/gms
parentHandle POSIX correctness in ~/.bash_profile (diff)
downloaddotfiles-c8ab406749124d2e762ad5cf53963070113afd0f.tar.gz
dotfiles-c8ab406749124d2e762ad5cf53963070113afd0f.zip
Apply runtime shebanging to POSIX shell
Diffstat (limited to 'bin/gms')
-rwxr-xr-xbin/gms31
1 files changed, 0 insertions, 31 deletions
diff --git a/bin/gms b/bin/gms
deleted file mode 100755
index 01cdaa2f..00000000
--- a/bin/gms
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-# Run getmail(1) over every getmailrc.* file in ~/.getmail
-
-# Trap to remove whatever's set in lockdir if we're killed
-lockdir=
-cleanup() {
- [ -n "$lockdir" ] && rm -fr -- "$lockdir"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-
-# Don't trust the environment $UID, use id(1) instead
-uid=$(id -u) || exit
-
-# Iterate through the getmailrc.* files in $GETMAIL if defined, or
-# $HOME/.getmail if not
-for rcfile in "${GETMAIL:-"$HOME"/.getmail}"/getmailrc.* ; do (
- lockdir=${TMPDIR:-/tmp}/getmail.$uid.${rcfile##*/}.lock
- mkdir -m 0700 -- "$lockdir" 2>/dev/null || exit
- try -n 3 -s 15 getmail --rcfile "$rcfile" "$@"
- rm -fr -- "$lockdir" && lockdir=
-) & done
-
-# Wait for all of the enqueued tasks to finish
-wait