lstu_upstart.conf 575 Bytes
Newer Older
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 26 27 28
# -*- upstart -*-
description "lstu"
author "Luc Didry <luc@didry.org>"

start on (networking)
stop on runlevel [!2345]

script
  if [ -f "/etc/default/lstu" ]
  then
    . /etc/default/lstu
    if [ -z $LDIR ]
    then
      echo "LDIR variable is empty, please fill it in /etc/default/lstu"
      exit 0
    fi
    if [ -z $USER ]
    then
      echo "USER variable is empty, please fill it in /etc/default/lstu"
      exit 0
    fi
  else
    echo "Missing /etc/default/lstu file"
    exit 0
  fi
  cd $LDIR
  su $USER -c "carton exec hypnotoad -f script/lstu"
end script