QaRahul
June 26th, 2010, 08:06 PM
Hello All,
I need to write a perl script to enable/disable an network interface inside perl script.
I already did that but I just need to handle the error returned by ifup / ifdown inside the script itself. That is I don't want the error results by the ifup/ifdown to be printed on the shell rather I wish to manipulate the error. For ex. see the following script:
#usr/bin/perl -w
`ifup eth0`;
now suppose that user runs this script as non - root this script returns an error like permission denied. But I don't want to print this error, rather I wish to some other message.
How I could do this??? Help please!!!
I need to write a perl script to enable/disable an network interface inside perl script.
I already did that but I just need to handle the error returned by ifup / ifdown inside the script itself. That is I don't want the error results by the ifup/ifdown to be printed on the shell rather I wish to manipulate the error. For ex. see the following script:
#usr/bin/perl -w
`ifup eth0`;
now suppose that user runs this script as non - root this script returns an error like permission denied. But I don't want to print this error, rather I wish to some other message.
How I could do this??? Help please!!!