failat 9999999

rx "exit show('p','JAMMAIL')"
if ${RC} eq 1
  rx "Address 'JAMMAIL' 'Abort'"
  echo "Killing Current Running JamMail!"
endif
rx "exit show('p','LOGPROC')"
if ${RC} eq 0
  run <NIL: >nil: logproc
  wait 2
  echo "Waiting for LogProc"
  rx "Address 'LOGPROC' 'OpenLog jammailfile f Logs:JamMail.log'"
  rx "Address 'LOGPROC' 'OpenLog jammailwind w RAW:0/13/724/198/JamMail Log Window/inactive/NODRAG/SCREENJamLogs'"
  rx "Address 'LOGPROC' 'AddLogGroup JamMailLogs jammailwind jammailfile'"

  rx "Address 'LOGPROC' 'OpenLog jm-phonefile f logs:Phone.log'"
  rx "Address 'LOGPROC' 'AddLogGroup jammailphone jm-phonefile'"
else
  Echo "Logging system already active"
endif
if NOT EXISTS logs:Phone.log
  echo  >logs:Phone.log "   Date     Time   Duration      Number    Type      Address        Location"
  echo >>logs:Phone.log "--------- -------- -------- -------------- ---- ------------------- ---------"
endif
echo "Launching JAMMAIL"

newshell window=RAW:0/214/360/70/Setup/inactive/NODRAG/SCREENJamLogs from s:setup.cli

