From 094ca96844842928810f14844413109fc6cdd890 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sun, 3 Feb 2013 00:59:38 -0700 Subject: Initial Alpine Version --- web/bin/README | 20 ++++++++++++++++++++ web/bin/alpine.tcl | 1 + web/bin/launch.tcl | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ web/bin/tclsh | 1 + web/bin/usage.tcl | 24 ++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 web/bin/README create mode 120000 web/bin/alpine.tcl create mode 100755 web/bin/launch.tcl create mode 120000 web/bin/tclsh create mode 100755 web/bin/usage.tcl (limited to 'web/bin') diff --git a/web/bin/README b/web/bin/README new file mode 100644 index 00000000..a6f5fa90 --- /dev/null +++ b/web/bin/README @@ -0,0 +1,20 @@ +# ======================================================================== +# Copyright 2006 University of Washington +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# ======================================================================== + + + this directory holds binaries for use by the web alpine cgi. + the alpined is the serverlet that provides mailbox + data and session management to the web alpine scripts. + + make sure alpined resides in this directory. + + make sure tclsh points to the tclsh binary for your system. + diff --git a/web/bin/alpine.tcl b/web/bin/alpine.tcl new file mode 120000 index 00000000..976166f1 --- /dev/null +++ b/web/bin/alpine.tcl @@ -0,0 +1 @@ +../config/alpine.tcl \ No newline at end of file diff --git a/web/bin/launch.tcl b/web/bin/launch.tcl new file mode 100755 index 00000000..8751c33f --- /dev/null +++ b/web/bin/launch.tcl @@ -0,0 +1,51 @@ +#!./tclsh +# $Id: launch.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $ +# ======================================================================== +# Copyright 2006 University of Washington +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# ======================================================================== + +# Generate a session key, create the connection points (fifos), +# spawn the mail engine and then hand the session key to the +# caller + +# Source config information +source ./alpine.tcl + +# generate session id +WPValidId + +if {[info exists env(REMOTE_USER)]} { + set servlet $_wp(pc_servlet) + set env(LOGNAME) $env(REMOTE_USER) +} else { + set servlet $_wp(servlet) +} + +set cmd "exec -- echo $_wp(sockname) | [file join $_wp(bin) $servlet]" + +# set debug level and configure dmalloc +#append cmd " -d -d -d -d -d -d -d" +#set env(DMALLOC_OPTIONS) "check-fence,check-heap,check-blank,log=/tmp/logfile.%d" + +if {[catch {eval $cmd} errmsg]} { + puts stderr "Unable to Launch servlet: $errmsg" + exit 1 +} elseif {[info exists env(REMOTE_ADDR)] && [string length $env(REMOTE_ADDR)]} { + catch {WPCmd PEInfo set wp_client $env(REMOTE_ADDR)} +} elseif {[info exists env(REMOTE_HOST)] && [string length $env(REMOTE_HOST)]} { + catch {WPCmd PEInfo set wp_client $env(REMOTE_HOST)} +} + +if {$_wp(debug) > 0} { + WPCmd PEDebug level $_wp(debug) +} + +puts $_wp(sessid) +exit 0 diff --git a/web/bin/tclsh b/web/bin/tclsh new file mode 120000 index 00000000..89acb765 --- /dev/null +++ b/web/bin/tclsh @@ -0,0 +1 @@ +/usr/bin/tclsh \ No newline at end of file diff --git a/web/bin/usage.tcl b/web/bin/usage.tcl new file mode 100755 index 00000000..8b597951 --- /dev/null +++ b/web/bin/usage.tcl @@ -0,0 +1,24 @@ +#!./tclsh +# $Id: usage.tcl 1169 2008-08-27 06:42:06Z hubert@u.washington.edu $ +# ======================================================================== +# Copyright 2008 University of Washington +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# ======================================================================== + +# Return mail store usage numbers on stdout separated by a space +# First number is amount of usage +# Second is total amount of space available +# Integer values. Unit are megabytes (MB). + +set cmd "exec -- /usr/local/bin/dmq -u [lindex $argv 0]" +if {0 == [catch {eval $cmd} result]} { + if {[regexp {^[0-9]+[ \t]+([0-9]+)\.[0-9]*[ \t]+([0-9]+)$} $result dummy usage total]} { + puts stdout "$usage $total" + } +} -- cgit v1.2.3-54-g00ecf