F
Fabio
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
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