Index: /trunk/Ohana/src/shell/src/elixir.launch
===================================================================
--- /trunk/Ohana/src/shell/src/elixir.launch	(revision 77)
+++ /trunk/Ohana/src/shell/src/elixir.launch	(revision 78)
@@ -46,4 +46,48 @@
 endif
 
+if ($1 == "imstatreg") then
+    switch ($camera)
+     case cfhtir:
+     case cfh12k:
+     case megacam:
+      echo "checking for existing imstatreg -daemon"
+      imstatreg -D CAMERA $camera -daemon -status
+      if ($status) then
+	echo "no imstatreg -daemon, starting..."
+	imstatreg -D CAMERA $camera -daemon
+	if ($status) then
+	    echo "error starting imstatreg -daemon"
+	endif
+      endif
+      breaksw;
+
+     default:
+      echo "no imstatreg -daemon needed for $camera"
+      breaksw;
+    endsw
+    exit 0;
+endif
+
+if ($1 == "cadc") then
+    switch ($camera)
+     case cfh12k:
+     case megacam:
+      set date = `date -u +%Y%m%d+%H:%M:%S`
+      imsearch -D CAMERA $camera -trange now -1d -dist f -cadctable /h/ftp/pub/fits_hdrs/mcmd.raw.$date.fits
+      cp /h/ftp/pub/fits_hdrs/mcmd.raw.$date.fits /data/elixir2/datdir/cadc/
+      if ($status) then
+	echo "error extracting cadc table"
+	exit 1;
+      endif
+      imsearch -D CAMERA $camera -trange now -1d -dist f -modify dist t
+      breaksw;
+
+     default:
+      echo "no CADC table needed for $camera"
+      breaksw;
+    endsw
+    exit 0;
+endif
+
 if ($1 == "sextract") then
     switch ($camera)
