2

I'm trying to run a command after a share is mounted with vagrant. bu I've never written an upstart script before. What I have so far is

start on vagrant-mounted

script
  if [ "$MOUNTPOINT" = "/vagrant" ]
     then
         env CMD="echo $MOUNTPOINT mounted at $(date)"
  elif [ "$MOUNTPOINT" = "/srv/website" ]
     then
         env CMD ="echo execute command"
  fi
end script

exec "$CMD >> /var/log/vup.log"

of course that's not the actual script I want to run but I haven't gotten that far yet but the structure is what I need. My starting point has been this article. I've had a different version that was simply

echo $MOUNTPOINT mounted at `date`>> /var/log/vup.log

that version did write to the log. Trying to use init-checkconf faile with failed to ask Upstart to check conf file

Rune FS
  • 21,497
  • 7
  • 62
  • 96

0 Answers0