summaryrefslogtreecommitdiff
path: root/ec2init-disable.conf
blob: b9d57f06415c6ac0c8dab3a533b1cda7dd61b169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
start on startup
normal exit 0 1

console output

script
  set +e
  i=0
  while ! touch /etc/TEST >/dev/null 2>&1; do
     echo "DISABLER: waiting for writable /"
     sleep 1
     i=$(($i+1))
     [ $i -lt 30 ] || { echo "DISABLER: bailing"; exit 0; }
  done
  f="/etc/init/ec2init.conf"
  [ -e "$f" ] || { echo "DISABLER: no ${f}, exiting"; exit 0; }
  echo "DISABLER: sleeping 5, then disabling ${f}"
  sleep 5
  mv "${f}" "${f}.disabled" &&
     echo "DISABLER: disabled ${f}" ||
     echo "DISABLER: failed mv ${f} ${f}.disabled"
  exit 0
end script