1#!/bin/sh
2
3while true; do
4  devcds=`find /sys/devices/virtual/devcoredump/ -name data 2>/dev/null`
5  for i in $devcds; do
6    echo "Found a devcoredump at $i."
7    if cp $i /results/first.devcore; then
8      echo 1 > $i
9      echo "Saved to the job artifacts at /first.devcore"
10      exit 0
11    fi
12  done
13  sleep 10
14done
15