title: bash script to open chrome then turn computer off when chrome is closed
body: <p>I would like to write the a startup script in bash to make an ubuntu box more grandpa-friendly.</p>
  
  <p>The script should:</p>
  
  <p>open chrome
  wait until chrome is closed
  turn computer off</p>
  
  <p>so far I have</p>
  
  <pre><code>#!/bin/bash
  if [ -z "$1" ]; then
      address="http:\\www.google.co.uk"
  else
      address=$1
  fi
  
  echo starting the internet
  google-chrome $address
  
  while [ 1=1 ];
  do
     grep_resp=$(ps aux | grep chrome)
     if [ -z "$grep_resp" ]; then
         echo turning computer off 
     else
         echo chrome still running
     fi
     sleep 5
  done 
  </code></pre>
  
  <p>but the grep for "chrome" is in the process list</p>
  
  <p>Any aid?</p>