# Contributor: sev <alpine@sev.monster>
# Maintainer: sev <alpine@sev.monster>
pkgname=cronwrap
-pkgver=1.0.0
+pkgver=1.1.0
pkgrel=0
pkgdesc="Pipe a command's output to a logfile with datestamps"
url="https://git.sev.monster/aports.git"
}
sha512sums="
-1d89508f7b1683a802e1c3c09794e22c17ab26fec2c3ec7023c588b56a7ed609f111aed917fcd81af11df6c2ec832ca3fe196436cbf9eb609746c07552d46769 cronwrap
+ca9ec4833d0bc3e33b63fa511dc324b133da4ba4c04fb7860122242697116c11e0ca95836cf75c9463968e3801523d470defa03d87e23d005f3154a657713a03 cronwrap
"
set -eu
set -o pipefail
+_b=$(basename $1)
+
"$@" 2>&1 \
- | awk "{print strftime(\"%b %d %H:%M:%S `hostname -s` info $1[$$] \"), \$0; fflush();}" \
- | tee -a "/var/log/$1.cron.log"
+ | awk "{print strftime(\"%b %d %H:%M:%S `hostname -s` info $_b[$$] \"), \$0; fflush();}" \
+ | tee -a "/var/log/$_b.cron.log"