i'm trying to get a script working upon connection with pppd
According to docu this happens ina clean environment with a couple of variables set, namely $1,$2,...
To be able to execute the statements i included a path statement but i think i'm running into trouble with the variables - i get an invalid argument error.
(forgot to mention the script works fine from vanilla prompt as root - same credentials pppd uses to execute the script)
i think this line gives the problem:
dynip=$(ifconfig ppp0 | grep 'inet addr' | grep -v '127.0.0.1'| awk '{print $2}' | cut -d: -f2)
is it possible that $2 is interpreted as the variable the script recieved from pppd on start instead of using the previous statement as input?
Last edited by vgersh99; 02-07-2009 at 12:33 PM..
Reason: vB Codes
i did not say i was an expert at shellscripting
the export seemed cautious - but i'll remove it
the script has been made mostly from snippets i collected on the internet
here's what i get for ifconfig ppp0:
seems the grep -v shouldnt be there either but it works - its a line i picked for displaying an ip adress on a linux machine and i need that to set up portforwarding once the dialup connection is established
anyway - the reason i put in the path was because i was trying to 'get' the same environment i get at the prompt - where the thing works ...
Last edited by vgersh99; 02-07-2009 at 12:44 PM..
Reason: fix the VB Codes: \code != /code
well that line works at the prompt :
this is probably also the right time to tell that pppd redirects script output to /dev/null - all i get in the log is :
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Try running 'phone4 xyz' and see what happens.
Modify your program so that if no matching name is found, an... (1 Reply)
Hi Guys i have a <script?> that spits out the location of each printer using snpget
here is the code
for i in `sed -n '/Start Printer/,/End Printer/p' /hosts/blah/etc/dhcp/hosts.conf | awk '!/^#/ {print $2}' | egrep -v \... (2 Replies)
Try to imagine a flag:
nnnnx
nnnxx
nnxxx
nxxxx
now imagine how it will output:
4 times the "n"and 1 times "x"
3 times "n"and" 2 times" x "
.. etc. ..
rhombus is the same only instead of "n" is there
gap "and " x "is a few times to form the correct shape
Can you help... (3 Replies)
Hello everyone!!!! I am new to this forum ...I have a problem. And I thought that you are expert :) so you can help me with that... I have a text file with maaany lines. Every line begins with something like that:
<http aksjfskcuhrf kushkfsnus> <http sxnfrksehfsd gsdg r> I don't know if every... (16 Replies)
have this code but when i run it i get this error
./pulse: line 2: and here is the code
#!/bin/bash
if ;
then
pulseaudio -k;
fi
what am i doing wrong
thanks
Adam (5 Replies)
Hi,
can anyone help me with my scrip please. I wanted do following tasks:
1. List all the directory
2. A STDIN to ask user to enter a directory name from listed directories
3. command to check if the directory exists( or a command to validate if the user entered a valid directory name)
... (2 Replies)
Hi,
can anyone help me with my scrip please. I wanted do following tasks:
1. List all the directory
2. A STDIN to ask user to enter a directory name from listed directories
3. command to check if the directory exists( or a command to validate if the user entered a valid directory name)... (3 Replies)
Hello,
I'm confused (oh, yes). I'm running Linux at work. When I type 'echo $SHELL' I am told that I'm running tcsh. In /bin I note that both tcsh and bash are listed.
Question 1: Can I swap to run bash rather than tcsh and, if so, how will this affect my system? Is there any advantage to... (6 Replies)
Hello there peeps:
There is a little piece of bash shell scripting problem i have, which i was hoping you could help me with.
#!/bin/bash
stored_word()
{
case $(( $$ % 8 )) in
0 ) echo "energy";;
1 ) echo "touch";;
2 ) echo "climbing";;
3 ) echo... (3 Replies)