File: debci-worker.cron.daily

package info (click to toggle)
debci 2.15.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,268 kB
  • sloc: ruby: 4,386; sh: 2,861; javascript: 96; makefile: 82; perl: 11
file content (25 lines) | stat: -rwxr-xr-x 350 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -e

if ! dpkg-query --show debci-worker >/dev/null 2>&1; then
  exit
fi

if ! which debci >/dev/null 2>&1; then
  exit
fi

log=$(mktemp)
cleanup() {
  rm -f "$log"
}
trap cleanup INT TERM EXIT

# only output anything if `debci setup` fails
rc=0
debci update-worker >"$log" 2>&1 || rc=$?
if [ $rc -ne 0 ]; then
  cat "$log"
fi
exit $rc