calling kermit script through JSP page - Protocols

This is a discussion on calling kermit script through JSP page - Protocols ; hi all, I would like to thank all of you and greatly to the "creator" of kermit, Mr. Frank. I was able to get connected to a GSM modem and was able to transfer a 100kb of file from one ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: calling kermit script through JSP page

  1. calling kermit script through JSP page

    hi all,

    I would like to thank all of you and greatly to the "creator" of
    kermit, Mr. Frank.
    I was able to get connected to a GSM modem and was able to transfer a
    100kb of file from one end to other using kermit.

    The kermit script(following) is written to attain the functionality.
    The script when executed from the terminal executes well,
    like this "./script_name "
    But i am facing a small problem...
    when the script is called from a JSP page it partially runs!
    meaning ...please see the following comments in brackets in script.
    #!/usr/bin/kermit + ;SCRIPT START
    set disconnect on
    set line /dev/ttyS0 .....(DOES NOT WORKS)

    open write /vikrant/check.txt......(WORKS)
    write file \%1 \%2 ......(WORKS)
    close write-file ......(WORKS)

    set exit warning off
    cd /vikrant/inbox
    set dial timeout 70
    dial \%1 .....(DOES NOT WORKS)
    if fail exit 1
    kermit -g /vikrant/outbox/*\%2
    exit ;SCRIPPT END

    Meaning ...the 3 line are executed which writes 2 parameters
    into a file "check.txt"
    the "set line" and "dial" command is not executed ...where as, it is
    all executed
    when invoked from terminal

    what probably would be the reason ?
    with regards
    Vikrant


  2. Re: calling kermit script through JSP page

    Well i got the solution for the above problem
    the solution was :
    "set line /dev/ttyS0" ...was not working because the jsp page was not
    having permissions to LOCK the /ttyS0 (i.e. comm1)port.
    i.e. the file /var/lock was not having sufficient permissions.


  3. Re: calling kermit script through JSP page

    On 2005-04-14, vikrant.shahir@gmail.com wrote:
    : Well i got the solution for the above problem
    : the solution was :
    : "set line /dev/ttyS0" ...was not working because the jsp page was not
    : having permissions to LOCK the /ttyS0 (i.e. comm1)port.
    : i.e. the file /var/lock was not having sufficient permissions.
    :
    This is documented in the manual, and also here:

    http://www.columbia.edu/kermit/ckuins.html#x10

    (Sections 10 and 11).

    Also, as noted in the script-writing tutorial:

    http://www.columbia.edu/kermit/ckscripts.html

    any command that can fail should be followed by an IF FAIL command that
    catches the failure, so that the script does not continue executing as
    if the failed command had succeeded.

    - Frank

+ Reply to Thread