#!/bin/sh # workaround for /sbin being missing sometimes, which causes all abuild operations # to fail silently since apk is not in path export PATH="/usr/bin:/usr/sbin:/bin:/sbin" arch=$(apk --print-arch) pub() { mosquitto_pub -L mqtts://build:build@mqtt.torastian.com/build/$arch -m "$1" } echo "pulling git" pub "pulling git" cd "$HOME/ptrcports" git fetch --all git reset --hard origin/master nice -n 10 buildrepo \ -a "$HOME" \ -d /var/www/repo.ptrc.pl \ -l "$HOME/logs" \ -p ptrcports | while read -r line; do echo "$line" echo "$line" | grep -q 'ptrcports/' && pub "$line" done echo "idle" pub "idle"