Running a New Process

Discussion in 'Perl' started by Fabio, Dec 23, 2003.

  1. Fabio

    Fabio Guest

    Hello,

    there's something I'd like to understand...

    I want to connect to the MS SQL Server database, get some records, store
    them into the text file, send the file through VPN connection and then
    send the email message about the task success or failure.

    First steps are quite easy but using the VPN connection makes me feel
    powerless... How can I start the VPN client from the Perl script?

    My script looks like that:

    # some lines of code

    `sh /etc/init.d/vpnclient_init start` || die "vpn init: $!\n";
    system("vpnclient connect default user xxx pwd xxx");
    system("smbmount //192.168.0.1/xxx /mnt/xxx -o username=xxx,password=xxx");

    When I run the script it gets the data from SQL Server, creates the text
    file and prints out the following text:

    # Cisco Systems VPN Client Version 4.0.3 (B)
    # Copyright (C) 1998-2003 Cisco Systems, Inc. All Rights Reserved.
    # Client Type(s): Linux
    # Running on: Linux 2.4.21-144-default #1 Fri Nov 14 00:01:36 UTC 2003 #
    # i686

    # WARNING:
    # Using the "pwd" option may allow other users
    # on this computer to see your password.

    # Initializing the VPN connection.
    # Contacting the gateway at XXX.XXX.XXX.XXX
    # Authenticating user.
    # Negotiating security policies.
    # Securing communication channel.
    # Your VPN connection is secure.

    After printing this text my VPN connection is active and it works fine.
    But the following Perl instructions aren't executed. I can use the VPN
    connection from another console window but I don't want it to work that
    way. All I want is executing the whole Perl script including the
    instructions following the VPN connection initialization.

    Thanks for any advice.

    ...:: fabio
    Fabio, Dec 23, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jona
    Replies:
    2
    Views:
    800
  2. John English
    Replies:
    0
    Views:
    5,209
    John English
    Nov 7, 2005
  3. Erik Geiger
    Replies:
    9
    Views:
    428
    Keith Dart
    Dec 22, 2004
  4. Replies:
    2
    Views:
    449
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
  5. Victor Hooi
    Replies:
    1
    Views:
    133
    Nobody
    Feb 10, 2013
Loading...

Share This Page