ansible: Add cron job to reboot armhf nodes that have gone read-only
[lttng-ci.git] / automation / ansible / roles / common-node / files / readonly_root_reboot.sh
1 #!/usr/bin/bash
2
3 IFS=',' read -r -a OPTIONS < <(findmnt --json / | jq -r '.[][0]["options"]')
4 RO=
5 for OPTION in "${OPTIONS[@]}" ; do
6 if [[ "${OPTION}" == "ro" ]] ; then
7 RO=0
8 break
9 fi
10 done
11
12 if [[ "${RO}" == "0" ]] ; then
13 echo "'/' is mounted read-only, rebooting"
14 shutdown -r "+1"
15 fi
This page took 0.028619 seconds and 4 git commands to generate.