~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to web/bin/launch.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!./tclsh
 
2
# $Id: launch.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
 
3
# ========================================================================
 
4
# Copyright 2006 University of Washington
 
5
#
 
6
# Licensed under the Apache License, Version 2.0 (the "License");
 
7
# you may not use this file except in compliance with the License.
 
8
# You may obtain a copy of the License at
 
9
#
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# ========================================================================
 
13
 
 
14
#  Generate a session key, create the connection points (fifos),
 
15
#  spawn the mail engine and then hand the session key to the
 
16
#  caller
 
17
 
 
18
# Source config information
 
19
source ./alpine.tcl
 
20
 
 
21
# generate session id
 
22
WPValidId
 
23
 
 
24
if {[info exists env(REMOTE_USER)]} {
 
25
  set servlet $_wp(pc_servlet)
 
26
  set env(LOGNAME) $env(REMOTE_USER)
 
27
} else {
 
28
  set servlet $_wp(servlet)
 
29
}
 
30
 
 
31
set cmd "exec -- echo $_wp(sockname) | [file join $_wp(bin) $servlet]"
 
32
 
 
33
if {[catch {eval $cmd} errmsg]} {
 
34
    puts stderr "Unable to Launch servlet: $errmsg"
 
35
    exit 1
 
36
} elseif {[info exists env(REMOTE_ADDR)] && [string length $env(REMOTE_ADDR)]} {
 
37
  catch {WPCmd PEInfo set wp_client $env(REMOTE_ADDR)}
 
38
} elseif {[info exists env(REMOTE_HOST)] && [string length $env(REMOTE_HOST)]} {
 
39
  catch {WPCmd PEInfo set wp_client $env(REMOTE_HOST)}
 
40
}
 
41
 
 
42
if {$_wp(debug) > 0} {
 
43
    WPCmd PEDebug level $_wp(debug)
 
44
}
 
45
 
 
46
puts $_wp(sessid)
 
47
exit 0